@scalar/openapi-to-markdown 0.2.35 → 0.2.37

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,26 @@
1
1
  # @scalar/openapi-to-markdown
2
2
 
3
+ ## 0.2.37
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [498f771]
8
+ - Updated dependencies [bff46e5]
9
+ - Updated dependencies [8f2a2f2]
10
+ - @scalar/components@0.14.34
11
+ - @scalar/helpers@0.0.11
12
+ - @scalar/oas-utils@0.4.29
13
+ - @scalar/openapi-parser@0.20.6
14
+
15
+ ## 0.2.36
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [39bbc0e]
20
+ - @scalar/openapi-parser@0.20.5
21
+ - @scalar/oas-utils@0.4.28
22
+ - @scalar/components@0.14.33
23
+
3
24
  ## 0.2.35
4
25
 
5
26
  ### Patch Changes
@@ -1,238 +1,229 @@
1
- import { defineComponent as K, createElementBlock as e, openBlock as t, createElementVNode as l, createBlock as j, createCommentVNode as r, toDisplayString as u, createTextVNode as i, unref as S, Fragment as o, renderList as b, createVNode as v } from "vue";
2
- import { ScalarMarkdown as x } from "@scalar/components";
3
- import { getExampleFromSchema as V } from "@scalar/oas-utils/spec-getters";
4
- import B from "./Schema.vue.js";
5
- import C from "./XmlOrJson.vue.js";
6
- const Q = { key: 1 }, X = { key: 0 }, Y = { key: 1 }, Z = { key: 2 }, h = { key: 0 }, a = { key: 1 }, T = { key: 0 }, c = { key: 1 }, _ = { key: 3 }, ll = { key: 2 }, nl = { key: 3 }, tl = { key: 0 }, el = { key: 1 }, ul = { key: 4 }, yl = /* @__PURE__ */ K({
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(sl) {
12
- return (y, n) => {
13
- var E, w, D, M, N, P, R, U, q, A, F, I, L, $, W, z, G;
14
- return t(), e("section", null, [
15
- l("header", null, [
16
- l("h1", null, u((w = (E = y.content) == null ? void 0 : E.info) == null ? void 0 : w.title), 1),
17
- l("ul", null, [
18
- l("li", null, [
19
- n[0] || (n[0] = l("strong", null, "OpenAPI Version:", -1)),
20
- n[1] || (n[1] = i(" ")),
21
- l("code", null, u((D = y.content) == null ? void 0 : D.openapi), 1)
22
- ]),
23
- l("li", null, [
24
- n[2] || (n[2] = l("strong", null, "API Version:", -1)),
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
- ])) : r("", !0),
66
- Object.keys(((I = y.content) == null ? void 0 : I.paths) ?? {}).length ? (t(), e("section", Z, [
67
- n[21] || (n[21] = l("h2", null, "Operations", -1)),
68
- (t(!0), e(o, null, b(Object.keys(((L = y.content) == null ? void 0 : L.paths) ?? {}), (s) => {
69
- var g, k;
70
- return t(), e(o, { key: s }, [
71
- (t(!0), e(o, null, b((k = (g = y.content) == null ? void 0 : g.paths) == null ? void 0 : k[s], (d, H) => {
72
- var J;
73
- return t(), e("section", { key: d }, [
74
- l("header", null, [
75
- l("h3", null, [
76
- d.summary ? (t(), e(o, { key: 0 }, [
77
- i(u(d.summary), 1)
78
- ], 64)) : (t(), e(o, { key: 1 }, [
79
- i(u(H.toString().toUpperCase()) + " " + u(s), 1)
80
- ], 64)),
81
- d["x-scalar-stability"] ? (t(), e(o, { key: 2 }, [
82
- i(" (" + u(d["x-scalar-stability"]) + ") ", 1)
83
- ], 64)) : d.deprecated ? (t(), e(o, { key: 3 }, [
84
- i(" ⚠️ Deprecated ")
85
- ], 64)) : r("", !0)
86
- ])
87
- ]),
88
- l("ul", null, [
89
- l("li", null, [
90
- n[11] || (n[11] = l("strong", null, "Method:", -1)),
91
- n[12] || (n[12] = i(" ")),
92
- l("code", null, u(H.toString().toUpperCase()), 1)
93
- ]),
94
- l("li", null, [
95
- n[13] || (n[13] = l("strong", null, "Path:", -1)),
96
- n[14] || (n[14] = i(" ")),
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("ul", null, [
181
- l("li", null, [
182
- n[22] || (n[22] = l("strong", null, "Method:", -1)),
183
- l("code", null, u(d.toString().toUpperCase()), 1)
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
- v(S(x), {
198
- value: k.description
199
- }, null, 8, ["value"])
200
- ]))), 128))
201
- ], 64))), 128))
202
- ])) : r("", !0),
203
- (G = (z = y.content) == null ? void 0 : z.components) != null && G.schemas && Object.keys(y.content.components.schemas).length ? (t(), e("section", ul, [
204
- n[29] || (n[29] = l("h2", null, "Schemas", -1)),
205
- (t(!0), e(o, null, b(y.content.components.schemas, (s, g) => (t(), e("section", { key: g }, [
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, u(s.title ?? g), 1)
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[27] || (n[27] = l("strong", null, "Type:", -1)),
212
- l("code", null, u(s.type), 1)
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
- s.description ? (t(), j(S(x), {
216
- key: 0,
217
- value: s.description
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
- ])) : r("", !0)
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
- yl as default
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 f, renderList as k, createVNode as d, createBlock as p, toDisplayString as u, createTextVNode as a } from "vue";
2
- const j = { key: 0 }, v = { key: 0 }, I = { key: 1 }, b = { key: 2 }, N = { key: 3 }, A = { key: 4 }, B = { key: 0 }, C = { key: 0 }, J = { key: 1 }, V = { key: 2 }, E = { key: 3 }, M = { key: 1 }, R = { key: 5 }, D = { key: 0 }, F = { key: 0 }, L = { key: 1 }, P = { key: 2 }, T = { key: 6 }, U = { key: 0 }, w = { key: 1 }, z = { key: 2 }, G = { key: 3 }, Q = /* @__PURE__ */ O({
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(H) {
8
- const c = (s, e) => {
9
- const r = Object.entries(s).sort(([l], [m]) => {
10
- const y = e == null ? void 0 : e.includes(l), h = e == null ? void 0 : e.includes(m);
11
- return y && !h ? -1 : !y && h ? 1 : l.localeCompare(m);
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(r);
13
+ return Object.fromEntries(m);
14
14
  };
15
- return (s, e) => {
16
- const r = g("Schema", !0);
17
- return s.schema ? (n(), t("section", j, [
18
- s.schema.allOf ? (n(), t("section", v, [
19
- e[0] || (e[0] = o("header", null, [
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(f, null, k(s.schema.allOf, (l, m) => (n(), t("section", { key: m }, [
23
- d(r, { schema: l }, null, 8, ["schema"])
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
- ])) : s.schema.anyOf ? (n(), t("section", I, [
26
- e[1] || (e[1] = o("header", null, [
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(f, null, k(s.schema.anyOf, (l, m) => (n(), t("section", { key: m }, [
30
- d(r, { schema: l }, null, 8, ["schema"])
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
- ])) : s.schema.oneOf ? (n(), t("section", b, [
33
- e[2] || (e[2] = o("header", null, [
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(f, null, k(s.schema.oneOf, (l, m) => (n(), t("section", { key: m }, [
37
- d(r, { schema: l }, null, 8, ["schema"])
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
- ])) : s.schema.not ? (n(), t("section", N, [
40
- e[3] || (e[3] = o("header", null, [
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
- d(r, {
45
- schema: s.schema.not
44
+ a(m, {
45
+ schema: e.schema.not
46
46
  }, null, 8, ["schema"])
47
47
  ])
48
- ])) : s.schema.type === "object" || s.schema.properties ? (n(), t("section", A, [
48
+ ])) : e.schema.type === "object" || e.schema.properties ? (n(), t("section", N, [
49
49
  o("ul", null, [
50
- (n(!0), t(f, null, k(c(
51
- s.schema.properties || {},
52
- s.schema.required
53
- ), (l, m) => {
54
- var y;
55
- return n(), t("li", { key: m }, [
56
- o("strong", null, [
57
- o("code", null, u(m), 1),
58
- (y = s.schema.required) != null && y.includes(m) ? (n(), t("span", B, " (required) ")) : i("", !0)
59
- ]),
60
- o("p", null, [
61
- o("code", null, u(Array.isArray(l.type) ? l.type.join(" | ") : l.type || "object"), 1),
62
- l.format ? (n(), t("span", C, [
63
- e[4] || (e[4] = a(", format: ")),
64
- o("code", null, u(l.format), 1)
65
- ])) : i("", !0),
66
- l.enum ? (n(), t("span", J, [
67
- e[5] || (e[5] = a(", possible values: ")),
68
- o("code", null, u(l.enum.map((h) => JSON.stringify(h)).join(", ")), 1)
69
- ])) : i("", !0),
70
- l.default !== void 0 ? (n(), t("span", V, [
71
- e[6] || (e[6] = a(", default: ")),
72
- o("code", null, u(JSON.stringify(l.default)), 1)
73
- ])) : i("", !0),
74
- l.description ? (n(), t("span", E, " " + u(l.description), 1)) : i("", !0)
75
- ]),
76
- l.type === "object" || l.properties ? (n(), p(r, {
77
- key: 0,
78
- schema: l
79
- }, null, 8, ["schema"])) : i("", !0),
80
- l.type === "array" && l.items ? (n(), t("section", M, [
81
- e[7] || (e[7] = o("header", null, [
82
- o("strong", null, "Items:")
83
- ], -1)),
84
- d(r, {
85
- schema: l.items
86
- }, null, 8, ["schema"])
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
- ])) : s.schema.type === "array" && s.schema.items ? (n(), t("section", R, [
92
- e[11] || (e[11] = o("header", null, [
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
- d(r, {
97
- schema: s.schema.items
93
+ a(m, {
94
+ schema: e.schema.items
98
95
  }, null, 8, ["schema"])
99
96
  ]),
100
- s.schema.minItems !== void 0 || s.schema.maxItems !== void 0 || s.schema.uniqueItems ? (n(), t("ul", D, [
101
- s.schema.minItems !== void 0 ? (n(), t("li", F, [
102
- e[8] || (e[8] = a(" Min items: ")),
103
- o("code", null, u(s.schema.minItems), 1)
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
- s.schema.maxItems !== void 0 ? (n(), t("li", L, [
106
- e[9] || (e[9] = a(" Max items: ")),
107
- o("code", null, u(s.schema.maxItems), 1)
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
- s.schema.uniqueItems ? (n(), t("li", P, e[10] || (e[10] = [
110
- a("Unique items: "),
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", T, [
111
+ ])) : (n(), t("section", P, [
115
112
  o("p", null, [
116
- o("code", null, u(s.schema.type), 1),
117
- s.schema.format ? (n(), t("span", U, [
118
- e[12] || (e[12] = a(", format: ")),
119
- o("code", null, u(s.schema.format), 1)
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
- s.schema.enum ? (n(), t("span", w, [
122
- e[13] || (e[13] = a(", possible values: ")),
123
- o("code", null, u(s.schema.enum.map((l) => JSON.stringify(l)).join(", ")), 1)
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
- s.schema.default !== void 0 ? (n(), t("span", z, [
126
- e[14] || (e[14] = a(", default: ")),
127
- o("code", null, u(JSON.stringify(s.schema.default)), 1)
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
- s.schema.description ? (n(), t("span", G, " — " + u(s.schema.description), 1)) : i("", !0)
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
- Q as default
134
+ K as default
138
135
  };
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "llm",
17
17
  "swagger"
18
18
  ],
19
- "version": "0.2.35",
19
+ "version": "0.2.37",
20
20
  "engines": {
21
21
  "node": ">=20"
22
22
  },
@@ -54,21 +54,21 @@
54
54
  "remark-stringify": "^11.0.0",
55
55
  "unified": "^11.0.4",
56
56
  "vue": "^3.5.17",
57
- "@scalar/helpers": "0.0.10",
58
- "@scalar/oas-utils": "0.4.27",
59
- "@scalar/components": "0.14.32",
57
+ "@scalar/components": "0.14.34",
58
+ "@scalar/helpers": "0.0.11",
59
+ "@scalar/oas-utils": "0.4.29",
60
+ "@scalar/openapi-parser": "0.20.6",
60
61
  "@scalar/openapi-types": "0.3.7",
61
- "@scalar/snippetz": "0.4.9",
62
- "@scalar/openapi-parser": "0.20.4",
63
- "@scalar/types": "0.2.15"
62
+ "@scalar/types": "0.2.15",
63
+ "@scalar/snippetz": "0.4.9"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@hono/node-server": "^1.11.0",
67
67
  "@types/html-minifier-terser": "^7.0.2",
68
- "@vitejs/plugin-vue": "^5.2.4",
68
+ "@vitejs/plugin-vue": "6.0.1",
69
69
  "@vue/test-utils": "^2.4.1",
70
70
  "hono": "^4.6.5",
71
- "vite": "6.1.6",
71
+ "vite": "7.1.5",
72
72
  "vue": "^3.5.17",
73
73
  "@scalar/build-tooling": "0.2.7",
74
74
  "@scalar/galaxy": "0.5.8"