@scalar/api-reference 1.30.0 → 1.31.0

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/browser/standalone.js +6352 -6334
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  6. package/dist/components/ApiReferenceLayout.vue2.js +164 -181
  7. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  8. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +56 -51
  10. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Content.vue.js +1 -1
  12. package/dist/components/Content/Content.vue2.js +5 -5
  13. package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
  14. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  16. package/dist/components/Content/Introduction/Introduction.vue2.js +57 -63
  17. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Lazy/Loading.vue.js +46 -46
  19. package/dist/components/Content/Models/Models.vue.d.ts +2 -2
  20. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Models/Models.vue.js +2 -2
  22. package/dist/components/Content/Models/Models.vue2.js +7 -6
  23. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts +2 -2
  24. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
  26. package/dist/components/Content/Schema/Schema.preview.d.ts +98 -56
  27. package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
  28. package/dist/components/Content/Schema/Schema.vue.d.ts +6 -3
  29. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  31. package/dist/components/Content/Schema/Schema.vue2.js +127 -118
  32. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
  33. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Schema/SchemaComposition.vue.js +57 -53
  35. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +1 -1
  36. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
  37. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  38. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  39. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -2
  40. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  41. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  42. package/dist/components/Content/Schema/SchemaProperty.vue2.js +40 -38
  43. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -2
  44. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  45. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  46. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +152 -152
  47. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -2
  48. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  49. package/dist/components/Content/Tag/TagList.vue.d.ts +2 -2
  50. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  51. package/dist/components/DocumentSelector/DocumentSelector.vue.js +3 -3
  52. package/dist/components/Layouts/ClassicLayout.vue.js +10 -8
  53. package/dist/components/Layouts/Layouts.vue.js +11 -9
  54. package/dist/components/Layouts/ModernLayout.vue2.js +22 -20
  55. package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
  56. package/dist/components/Section/SectionHeader.vue.js +2 -2
  57. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  58. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  59. package/dist/components/Sidebar/Sidebar.vue2.js +56 -56
  60. package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
  61. package/dist/components/SingleApiReference.vue.js +27 -33
  62. package/dist/esm.d.ts.map +1 -1
  63. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
  64. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  65. package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -50
  66. package/dist/features/ApiClientModal/useApiClient.d.ts +196 -196
  67. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  68. package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts +11 -0
  69. package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +1 -0
  70. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +38 -0
  71. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +21 -0
  72. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -0
  73. package/dist/features/DocumentSource/hooks/useDocumentSource.js +94 -0
  74. package/dist/features/DocumentSource/index.d.ts +2 -0
  75. package/dist/features/DocumentSource/index.d.ts.map +1 -0
  76. package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
  77. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  78. package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
  79. package/dist/features/DownloadLink/DownloadLink.vue2.js +18 -17
  80. package/dist/features/DownloadLink/index.d.ts +1 -0
  81. package/dist/features/DownloadLink/index.d.ts.map +1 -1
  82. package/dist/features/DownloadLink/openapi-version-symbol.d.ts +2 -0
  83. package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +1 -0
  84. package/dist/features/DownloadLink/openapi-version-symbol.js +4 -0
  85. package/dist/features/Operation/Operation.vue.d.ts +2 -2
  86. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  87. package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -2
  88. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  89. package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -2
  90. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  91. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +2 -2
  92. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
  93. package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
  94. package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -2
  95. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  96. package/dist/features/Operation/components/ParameterList.vue.js +2 -2
  97. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -2
  98. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  99. package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
  100. package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -6
  101. package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -2
  102. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  103. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  104. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +2 -2
  105. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  106. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  107. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +55 -55
  108. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  109. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  110. package/dist/features/Operation/layouts/ModernLayout.vue2.js +35 -32
  111. package/dist/features/Operation/types/schemas.d.ts +2 -2
  112. package/dist/features/Operation/types/schemas.d.ts.map +1 -1
  113. package/dist/features/Search/SearchButton.vue.js +2 -2
  114. package/dist/helpers/local-storage.d.ts +8 -0
  115. package/dist/helpers/local-storage.d.ts.map +1 -0
  116. package/dist/helpers/local-storage.js +6 -0
  117. package/dist/helpers/measure.d.ts +21 -0
  118. package/dist/helpers/measure.d.ts.map +1 -0
  119. package/dist/helpers/measure.js +7 -0
  120. package/dist/helpers/parse.d.ts +3 -5
  121. package/dist/helpers/parse.d.ts.map +1 -1
  122. package/dist/helpers/parse.js +64 -86
  123. package/dist/helpers/scroll-to-id.d.ts.map +1 -1
  124. package/dist/helpers/scroll-to-id.js +18 -4
  125. package/dist/index.d.ts +0 -1
  126. package/dist/index.d.ts.map +1 -1
  127. package/dist/index.js +33 -35
  128. package/dist/libs/openapi.d.ts +3 -3
  129. package/dist/libs/openapi.d.ts.map +1 -1
  130. package/dist/libs/openapi.js +35 -42
  131. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  132. package/dist/standalone/lib/html-api.js +15 -15
  133. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  134. package/dist/stores/useHttpClientStore.js +19 -18
  135. package/dist/style.css +1 -1
  136. package/dist/types.d.ts +27 -3
  137. package/dist/types.d.ts.map +1 -1
  138. package/package.json +13 -14
  139. package/dist/hooks/useReactiveSpec.d.ts +0 -448
  140. package/dist/hooks/useReactiveSpec.d.ts.map +0 -1
  141. package/dist/hooks/useReactiveSpec.js +0 -59
@@ -1,18 +1,18 @@
1
- import { defineComponent as F, ref as I, computed as k, watch as L, createBlock as t, createCommentVNode as o, openBlock as l, unref as n, withCtx as p, createElementVNode as V, normalizeClass as P, createElementBlock as s, withDirectives as z, createVNode as v, createTextVNode as b, toDisplayString as C, vShow as A, normalizeStyle as R, Fragment as u, renderList as M } from "vue";
2
- import { Disclosure as U, DisclosureButton as q, DisclosurePanel as G } from "@headlessui/vue";
3
- import { ScalarMarkdown as J, ScalarIcon as D } from "@scalar/components";
4
- import { getDiscriminatorMapping as K, getDiscriminatorPropertyName as Q, mergeDiscriminatorSchemas as W } from "./helpers/schema-discriminator.js";
5
- import X from "./SchemaDiscriminator.vue.js";
6
- import T from "../../ScreenReader.vue.js";
7
- import Y from "./SchemaHeading.vue.js";
8
- import H from "./SchemaProperty.vue.js";
9
- const Z = {
1
+ import { defineComponent as L, ref as R, computed as p, watch as U, createBlock as o, createCommentVNode as s, openBlock as l, unref as n, withCtx as v, createElementVNode as V, normalizeClass as N, createElementBlock as t, withDirectives as z, createVNode as h, createTextVNode as P, toDisplayString as H, vShow as A, normalizeStyle as G, Fragment as d, renderList as q } from "vue";
2
+ import { Disclosure as J, DisclosureButton as T, DisclosurePanel as K } from "@headlessui/vue";
3
+ import { ScalarMarkdown as Q, ScalarIcon as S } from "@scalar/components";
4
+ import { getDiscriminatorMapping as W, getDiscriminatorPropertyName as X, mergeDiscriminatorSchemas as Y } from "./helpers/schema-discriminator.js";
5
+ import Z from "./SchemaDiscriminator.vue.js";
6
+ import $ from "../../ScreenReader.vue.js";
7
+ import _ from "./SchemaHeading.vue.js";
8
+ import b from "./SchemaProperty.vue.js";
9
+ const x = {
10
10
  key: 0,
11
11
  class: "schema-card-description"
12
- }, _ = {
12
+ }, ee = {
13
13
  key: 0,
14
14
  class: "schema-properties"
15
- }, se = /* @__PURE__ */ F({
15
+ }, de = /* @__PURE__ */ L({
16
16
  __name: "Schema",
17
17
  props: {
18
18
  value: { type: [Object, Boolean] },
@@ -22,115 +22,119 @@ const Z = {
22
22
  noncollapsible: { type: Boolean, default: !1 },
23
23
  hideHeading: { type: Boolean },
24
24
  additionalProperties: { type: Boolean },
25
+ hideModelNames: { type: Boolean, default: !1 },
25
26
  schemas: {}
26
27
  },
27
- setup($) {
28
- const r = $, c = I(""), m = k(() => {
29
- if (r.value)
30
- return K(r.value);
31
- }), E = k(() => m.value && Object.keys(m.value)[0] || ""), N = k(() => {
32
- if (r.value)
33
- return Q(r.value);
34
- }), a = k(() => {
35
- if (r.value)
36
- return !m.value || !c.value ? r.value : W(
37
- r.value,
38
- c.value,
39
- r.schemas
40
- ) || r.value;
41
- }), O = k(() => !(r.noncollapsible || r.level === 0)), B = (e) => r.noncollapsible && e.stopPropagation();
42
- return L(
43
- m,
28
+ setup(E) {
29
+ const i = E, m = R(""), c = p(() => {
30
+ if (i.value)
31
+ return W(i.value);
32
+ }), F = p(() => c.value && Object.keys(c.value)[0] || ""), D = p(() => {
33
+ if (i.value)
34
+ return X(i.value);
35
+ }), a = p(() => {
36
+ if (i.value)
37
+ return !c.value || !m.value ? i.value : Y(
38
+ i.value,
39
+ m.value,
40
+ i.schemas
41
+ ) || i.value;
42
+ }), C = p(() => !(i.noncollapsible || i.level === 0)), I = p(() => {
43
+ var e;
44
+ return !(!((e = a.value) != null && e.description) || typeof a.value.description != "string" || a.value.allOf || a.value.oneOf || a.value.anyOf || a.value.enum || i.level === 0);
45
+ }), O = (e) => i.noncollapsible && e.stopPropagation();
46
+ return U(
47
+ c,
44
48
  (e) => {
45
- e && !c.value && (c.value = E.value);
49
+ e && !m.value && (m.value = F.value);
46
50
  },
47
51
  { immediate: !0 }
48
- ), (e, S) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), t(n(U), {
52
+ ), (e, M) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), o(n(J), {
49
53
  key: 0,
50
54
  defaultOpen: e.noncollapsible
51
55
  }, {
52
- default: p(({ open: d }) => {
53
- var j;
56
+ default: v(({ open: u }) => {
57
+ var B, w;
54
58
  return [
55
59
  V("div", {
56
- class: P(["schema-card", [
60
+ class: N(["schema-card", [
57
61
  `schema-card--level-${e.level}`,
58
- { "schema-card--compact": e.compact, "schema-card--open": d },
59
- { "border-t-1/2": e.additionalProperties && d }
62
+ { "schema-card--compact": e.compact, "schema-card--open": u },
63
+ { "border-t": e.additionalProperties && u }
60
64
  ]])
61
65
  }, [
62
- (j = a.value) != null && j.description && typeof a.value.description == "string" && !a.value.allOf && !a.value.oneOf && !a.value.anyOf && !e.compact ? (l(), s("div", Z, [
63
- a.value.enum ? o("", !0) : (l(), t(n(J), {
66
+ I.value ? (l(), t("div", x, [
67
+ (B = a.value) != null && B.enum ? s("", !0) : (l(), o(n(Q), {
64
68
  key: 0,
65
- value: a.value.description
69
+ value: (w = a.value) == null ? void 0 : w.description
66
70
  }, null, 8, ["value"]))
67
- ])) : o("", !0),
71
+ ])) : s("", !0),
68
72
  V("div", {
69
- class: P(["schema-properties", {
70
- "schema-properties-open": d
73
+ class: N(["schema-properties", {
74
+ "schema-properties-open": u
71
75
  }])
72
76
  }, [
73
- e.additionalProperties ? z((l(), s("div", _, [
74
- v(n(q), {
77
+ e.additionalProperties ? z((l(), t("div", ee, [
78
+ h(n(T), {
75
79
  as: "button",
76
80
  class: "schema-card-title schema-card-title--compact",
77
- onClickCapture: B
81
+ onClickCapture: O
78
82
  }, {
79
- default: p(() => [
80
- v(n(D), {
83
+ default: v(() => [
84
+ h(n(S), {
81
85
  class: "schema-card-title-icon",
82
86
  icon: "Add",
83
87
  size: "sm"
84
88
  }),
85
- S[1] || (S[1] = b(" Show additional properties ")),
86
- e.name ? (l(), t(T, { key: 0 }, {
87
- default: p(() => [
88
- b("for " + C(e.name), 1)
89
+ M[1] || (M[1] = P(" Show additional properties ")),
90
+ e.name ? (l(), o($, { key: 0 }, {
91
+ default: v(() => [
92
+ P("for " + H(e.name), 1)
89
93
  ]),
90
94
  _: 1
91
- })) : o("", !0)
95
+ })) : s("", !0)
92
96
  ]),
93
97
  _: 1
94
98
  })
95
99
  ], 512)), [
96
- [A, !d]
97
- ]) : O.value ? z((l(), t(n(q), {
100
+ [A, !u]
101
+ ]) : C.value ? z((l(), o(n(T), {
98
102
  key: 1,
99
103
  as: e.noncollapsible ? "div" : "button",
100
- class: P(["schema-card-title", { "schema-card-title--compact": e.compact }]),
101
- style: R({
104
+ class: N(["schema-card-title", { "schema-card-title--compact": e.compact }]),
105
+ style: G({
102
106
  top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
103
107
  }),
104
- onClickCapture: B
108
+ onClickCapture: O
105
109
  }, {
106
- default: p(() => {
107
- var h, y, f;
110
+ default: v(() => {
111
+ var f, y, g;
108
112
  return [
109
- e.compact ? (l(), s(u, { key: 0 }, [
110
- v(n(D), {
111
- class: P(["schema-card-title-icon", { "schema-card-title-icon--open": d }]),
113
+ e.compact ? (l(), t(d, { key: 0 }, [
114
+ h(n(S), {
115
+ class: N(["schema-card-title-icon", { "schema-card-title-icon--open": u }]),
112
116
  icon: "Add",
113
117
  size: "sm"
114
118
  }, null, 8, ["class"]),
115
- d ? (l(), s(u, { key: 0 }, [
116
- b(" Hide " + C(((h = e.value) == null ? void 0 : h.title) ?? "Child Attributes"), 1)
117
- ], 64)) : (l(), s(u, { key: 1 }, [
118
- b(" Show " + C(((y = e.value) == null ? void 0 : y.title) ?? "Child Attributes"), 1)
119
+ u ? (l(), t(d, { key: 0 }, [
120
+ P(" Hide " + H(((f = e.value) == null ? void 0 : f.title) ?? "Child Attributes"), 1)
121
+ ], 64)) : (l(), t(d, { key: 1 }, [
122
+ P(" Show " + H(((y = e.value) == null ? void 0 : y.title) ?? "Child Attributes"), 1)
119
123
  ], 64)),
120
- e.name ? (l(), t(T, { key: 2 }, {
121
- default: p(() => [
122
- b("for " + C(e.name), 1)
124
+ e.name ? (l(), o($, { key: 2 }, {
125
+ default: v(() => [
126
+ P("for " + H(e.name), 1)
123
127
  ]),
124
128
  _: 1
125
- })) : o("", !0)
126
- ], 64)) : (l(), s(u, { key: 1 }, [
127
- v(n(D), {
128
- class: P(["schema-card-title-icon", { "schema-card-title-icon--open": d }]),
129
+ })) : s("", !0)
130
+ ], 64)) : (l(), t(d, { key: 1 }, [
131
+ h(n(S), {
132
+ class: N(["schema-card-title-icon", { "schema-card-title-icon--open": u }]),
129
133
  icon: "Add",
130
134
  size: "sm"
131
135
  }, null, 8, ["class"]),
132
- v(Y, {
133
- name: ((f = e.value) == null ? void 0 : f.title) ?? e.name,
136
+ h(_, {
137
+ name: ((g = e.value) == null ? void 0 : g.title) ?? e.name,
134
138
  value: e.value
135
139
  }, null, 8, ["name", "value"])
136
140
  ], 64))
@@ -139,56 +143,58 @@ const Z = {
139
143
  _: 2
140
144
  }, 1032, ["as", "class", "style"])), [
141
145
  [A, !e.hideHeading && !(e.noncollapsible && e.compact)]
142
- ]) : o("", !0),
143
- v(n(G), {
146
+ ]) : s("", !0),
147
+ h(n(K), {
144
148
  as: "ul",
145
- static: !O.value
149
+ static: !C.value
146
150
  }, {
147
- default: p(() => {
148
- var h, y, f;
151
+ default: v(() => {
152
+ var f, y, g;
149
153
  return [
150
- m.value && ((h = a.value) != null && h.properties) ? (l(), t(X, {
154
+ c.value && ((f = a.value) != null && f.properties) ? (l(), o(Z, {
151
155
  key: 0,
152
- modelValue: c.value,
153
- "onUpdate:modelValue": S[0] || (S[0] = (i) => c.value = i),
154
- discriminatorMapping: m.value,
155
- discriminatorPropertyName: N.value
156
- }, null, 8, ["modelValue", "discriminatorMapping", "discriminatorPropertyName"])) : o("", !0),
157
- a.value && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (l(), s(u, { key: 1 }, [
158
- a.value.properties ? (l(!0), s(u, { key: 0 }, M(Object.keys(a.value.properties), (i) => {
159
- var g, w;
160
- return l(), t(H, {
161
- key: i,
156
+ modelValue: m.value,
157
+ "onUpdate:modelValue": M[0] || (M[0] = (r) => m.value = r),
158
+ discriminatorMapping: c.value,
159
+ discriminatorPropertyName: D.value
160
+ }, null, 8, ["modelValue", "discriminatorMapping", "discriminatorPropertyName"])) : s("", !0),
161
+ a.value && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (l(), t(d, { key: 1 }, [
162
+ a.value.properties ? (l(!0), t(d, { key: 0 }, q(Object.keys(a.value.properties), (r) => {
163
+ var k, j;
164
+ return l(), o(b, {
165
+ key: r,
162
166
  compact: e.compact,
163
167
  hideHeading: e.hideHeading,
164
168
  level: e.level + 1,
165
- name: i,
166
- required: ((g = a.value.required) == null ? void 0 : g.includes(i)) || ((w = a.value.properties[i]) == null ? void 0 : w.required) === !0,
169
+ name: r,
170
+ required: ((k = a.value.required) == null ? void 0 : k.includes(r)) || ((j = a.value.properties[r]) == null ? void 0 : j.required) === !0,
167
171
  schemas: e.schemas,
168
172
  value: {
169
- ...a.value.properties[i],
173
+ ...a.value.properties[r],
170
174
  parent: a.value,
171
- isDiscriminator: i === N.value
172
- }
173
- }, null, 8, ["compact", "hideHeading", "level", "name", "required", "schemas", "value"]);
174
- }), 128)) : o("", !0),
175
- a.value.patternProperties ? (l(!0), s(u, { key: 1 }, M(Object.keys(
175
+ isDiscriminator: r === D.value
176
+ },
177
+ hideModelNames: e.hideModelNames
178
+ }, null, 8, ["compact", "hideHeading", "level", "name", "required", "schemas", "value", "hideModelNames"]);
179
+ }), 128)) : s("", !0),
180
+ a.value.patternProperties ? (l(!0), t(d, { key: 1 }, q(Object.keys(
176
181
  a.value.patternProperties
177
- ), (i) => {
178
- var g;
179
- return l(), t(H, {
180
- key: i,
182
+ ), (r) => {
183
+ var k;
184
+ return l(), o(b, {
185
+ key: r,
181
186
  compact: e.compact,
182
187
  hideHeading: e.hideHeading,
183
188
  level: e.level,
184
- name: i,
189
+ name: r,
185
190
  pattern: "",
186
191
  schemas: e.schemas,
187
- value: ((g = e.value.discriminator) == null ? void 0 : g.propertyName) === i ? e.value : a.value.patternProperties[i]
188
- }, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value"]);
189
- }), 128)) : o("", !0),
190
- a.value.additionalProperties ? (l(), s(u, { key: 2 }, [
191
- a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (l(), t(H, {
192
+ value: ((k = e.value.discriminator) == null ? void 0 : k.propertyName) === r ? e.value : a.value.patternProperties[r],
193
+ hideModelNames: e.hideModelNames
194
+ }, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value", "hideModelNames"]);
195
+ }), 128)) : s("", !0),
196
+ a.value.additionalProperties ? (l(), t(d, { key: 2 }, [
197
+ a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (l(), o(b, {
192
198
  key: 0,
193
199
  additional: "",
194
200
  compact: e.compact,
@@ -199,8 +205,9 @@ const Z = {
199
205
  value: {
200
206
  type: "anything",
201
207
  ...typeof a.value.additionalProperties == "object" ? a.value.additionalProperties : {}
202
- }
203
- }, null, 8, ["compact", "hideHeading", "level", "schemas", "value"])) : (l(), t(H, {
208
+ },
209
+ hideModelNames: e.hideModelNames
210
+ }, null, 8, ["compact", "hideHeading", "level", "schemas", "value", "hideModelNames"])) : (l(), o(b, {
204
211
  key: 1,
205
212
  additional: "",
206
213
  compact: e.compact,
@@ -208,18 +215,20 @@ const Z = {
208
215
  level: e.level,
209
216
  noncollapsible: "",
210
217
  schemas: e.schemas,
211
- value: ((y = e.value.discriminator) == null ? void 0 : y.propertyName) === e.name ? e.value : a.value.additionalProperties
212
- }, null, 8, ["compact", "hideHeading", "level", "schemas", "value"]))
213
- ], 64)) : o("", !0)
214
- ], 64)) : (l(), t(H, {
218
+ value: ((y = e.value.discriminator) == null ? void 0 : y.propertyName) === e.name ? e.value : a.value.additionalProperties,
219
+ hideModelNames: e.hideModelNames
220
+ }, null, 8, ["compact", "hideHeading", "level", "schemas", "value", "hideModelNames"]))
221
+ ], 64)) : s("", !0)
222
+ ], 64)) : (l(), o(b, {
215
223
  key: 2,
216
224
  compact: e.compact,
217
225
  hideHeading: e.hideHeading,
218
226
  level: e.level,
219
227
  name: a.value.name,
220
228
  schemas: e.schemas,
221
- value: ((f = e.value.discriminator) == null ? void 0 : f.propertyName) === e.name ? e.value : a.value
222
- }, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value"]))
229
+ value: ((g = e.value.discriminator) == null ? void 0 : g.propertyName) === e.name ? e.value : a.value,
230
+ hideModelNames: e.hideModelNames
231
+ }, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value", "hideModelNames"]))
223
232
  ];
224
233
  }),
225
234
  _: 1
@@ -229,9 +238,9 @@ const Z = {
229
238
  ];
230
239
  }),
231
240
  _: 1
232
- }, 8, ["defaultOpen"])) : o("", !0);
241
+ }, 8, ["defaultOpen"])) : s("", !0);
233
242
  }
234
243
  });
235
244
  export {
236
- se as default
245
+ de as default
237
246
  };
@@ -1,8 +1,8 @@
1
- import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
2
  import { type CompositionKeyword } from './helpers/schema-composition.js';
3
3
  type __VLS_Props = {
4
4
  composition: CompositionKeyword;
5
- schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
5
+ schemas?: Record<string, OpenAPIV3_1.SchemaObject> | unknown;
6
6
  name?: string;
7
7
  value: Record<string, any>;
8
8
  level: number;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAwRA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAM9E,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AA2UF,wBAOG"}
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAuSA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAMxD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAA;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AAgWF,wBAOG"}
@@ -1,17 +1,17 @@
1
- import { defineComponent as E, ref as F, computed as m, resolveComponent as I, createElementBlock as u, openBlock as s, createCommentVNode as p, createBlock as f, Fragment as A, renderList as M, createVNode as b, createElementVNode as d, unref as v, withCtx as $, toDisplayString as B } from "vue";
2
- import { ScalarListbox as Z, ScalarMarkdown as G } from "@scalar/components";
3
- import { ScalarIconCaretDown as J } from "@scalar/icons";
4
- import { stringify as T } from "flatted";
5
- import { mergeAllOfSchemas as K } from "./helpers/merge-all-of-schemas.js";
1
+ import { defineComponent as U, ref as D, computed as s, resolveComponent as E, createElementBlock as u, openBlock as m, createCommentVNode as p, createBlock as f, Fragment as H, renderList as F, createVNode as b, createElementVNode as d, unref as v, withCtx as I, toDisplayString as w } from "vue";
2
+ import { ScalarListbox as M, ScalarMarkdown as $ } from "@scalar/components";
3
+ import { ScalarIconCaretDown as R } from "@scalar/icons";
4
+ import { stringify as j } from "flatted";
5
+ import { mergeAllOfSchemas as Z } from "./helpers/merge-all-of-schemas.js";
6
6
  import { hasComposition as g } from "./helpers/schema-composition.js";
7
7
  import S from "./Schema.vue.js";
8
- const P = { class: "property-rule" }, Q = {
9
- class: "composition-selector bg-b-1.5 hover:bg-b-2 py-1.25 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border border-b-0 px-2 pr-3 text-left",
8
+ const G = { class: "property-rule" }, J = {
9
+ class: "composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border border-b-0 px-2 py-1.25 pr-3 text-left",
10
10
  type: "button"
11
- }, R = { class: "text-c-2" }, X = { class: "composition-selector-label text-c-1 relative" }, Y = { class: "composition-panel" }, W = {
11
+ }, K = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1 relative" }, Q = { class: "composition-panel" }, X = {
12
12
  key: 0,
13
13
  class: "property-description border-x border-t p-2"
14
- }, ae = /* @__PURE__ */ E({
14
+ }, te = /* @__PURE__ */ U({
15
15
  __name: "SchemaComposition",
16
16
  props: {
17
17
  composition: {},
@@ -23,21 +23,21 @@ const P = { class: "property-rule" }, Q = {
23
23
  hideHeading: { type: Boolean }
24
24
  },
25
25
  setup(l) {
26
- const y = F(0), C = m(
26
+ const y = D(0), C = s(
27
27
  () => N.value.map((e, o) => ({
28
28
  id: String(o),
29
- label: z(e) || "Schema"
29
+ label: A(e) || "Schema"
30
30
  }))
31
- ), O = m({
31
+ ), O = s({
32
32
  get: () => C.value.find(
33
33
  (e) => e.id === String(y.value)
34
34
  ),
35
35
  set: (e) => y.value = Number(e.id)
36
- }), q = m(() => {
36
+ }), q = s(() => {
37
37
  var t;
38
38
  const e = ["oneOf", "anyOf"].includes(l.composition), o = l.composition === "allOf" && ((t = l.value[l.composition]) == null ? void 0 : t.some((n) => g(n)));
39
39
  return e || o;
40
- }), z = (e) => {
40
+ }), A = (e) => {
41
41
  if (!e)
42
42
  return null;
43
43
  if (e.title)
@@ -46,7 +46,7 @@ const P = { class: "property-rule" }, Q = {
46
46
  return e.name;
47
47
  if (l.schemas && typeof l.schemas == "object") {
48
48
  for (const [o, t] of Object.entries(l.schemas))
49
- if (T(t) === T(e))
49
+ if (j(t) === j(e))
50
50
  return o;
51
51
  }
52
52
  if (e.type === "array" && e.items)
@@ -59,11 +59,11 @@ const P = { class: "property-rule" }, Q = {
59
59
  return o[0];
60
60
  }
61
61
  return null;
62
- }, k = (e) => e.find((o) => g(o)), N = m(() => {
62
+ }, k = (e) => e.find((o) => g(o)), N = s(() => {
63
63
  if (!k(l.value[l.composition]))
64
64
  return l.value[l.composition];
65
65
  const e = k(l.value[l.composition]);
66
- return (e.oneOf || e.anyOf).map((t) => {
66
+ return (e.oneOf || e.anyOf || e.allOf).map((t) => {
67
67
  if (t.allOf) {
68
68
  const n = t.allOf.find((c) => c.title), r = t.allOf.find((c) => !c.title);
69
69
  return n && r ? {
@@ -82,7 +82,7 @@ const P = { class: "property-rule" }, Q = {
82
82
  }
83
83
  return t;
84
84
  });
85
- }), L = (e) => {
85
+ }), B = (e) => {
86
86
  var o, t;
87
87
  if (e === "allOf") {
88
88
  const n = (t = (o = l.value) == null ? void 0 : o[e]) == null ? void 0 : t.find(
@@ -94,57 +94,60 @@ const P = { class: "property-rule" }, Q = {
94
94
  return "Any of";
95
95
  }
96
96
  return e.replace(/([A-Z])/g, " $1").replace(/^./, (n) => n.toUpperCase()).toLowerCase().replace(/^(\w)/, (n) => n.toUpperCase());
97
- }, a = m(
97
+ }, i = s(
98
98
  () => N.value[y.value]
99
- ), h = m(() => {
99
+ ), h = s(() => {
100
100
  var e;
101
- return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
102
- }), U = m(() => {
101
+ return (e = i.value) != null && e.oneOf ? "oneOf" : "anyOf";
102
+ }), T = s(() => {
103
103
  var o;
104
104
  const e = h.value;
105
- return (o = a.value) == null ? void 0 : o[e];
105
+ return (o = i.value) == null ? void 0 : o[e];
106
+ }), z = s(() => {
107
+ const e = i.value;
108
+ return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
106
109
  });
107
110
  return (e, o) => {
108
- var n, r, c, V, H, w, j;
109
- const t = I("SchemaComposition", !0);
110
- return s(), u("div", P, [
111
- e.composition === "allOf" && e.value[e.composition].some((i) => i.oneOf || i.anyOf) ? (s(!0), u(A, { key: 0 }, M(e.value[e.composition].filter(
112
- (i) => !i.oneOf && !i.anyOf
113
- ), (i, D) => (s(), f(S, {
114
- key: D,
111
+ var n, r, c, V;
112
+ const t = E("SchemaComposition", !0);
113
+ return m(), u("div", G, [
114
+ e.composition === "allOf" && e.value[e.composition].some((a) => a.oneOf || a.anyOf) ? (m(!0), u(H, { key: 0 }, F(e.value[e.composition].filter(
115
+ (a) => !a.oneOf && !a.anyOf
116
+ ), (a, L) => (m(), f(S, {
117
+ key: L,
115
118
  compact: e.compact,
116
119
  level: e.level,
117
120
  name: e.name,
118
121
  noncollapsible: e.level == 0,
119
122
  schemas: e.schemas,
120
- value: i
123
+ value: a
121
124
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : p("", !0),
122
- q.value ? (s(), u(A, { key: 1 }, [
123
- b(v(Z), {
125
+ q.value ? (m(), u(H, { key: 1 }, [
126
+ b(v(M), {
124
127
  modelValue: O.value,
125
- "onUpdate:modelValue": o[0] || (o[0] = (i) => O.value = i),
128
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => O.value = a),
126
129
  options: C.value,
127
130
  resize: ""
128
131
  }, {
129
- default: $(() => {
130
- var i;
132
+ default: I(() => {
133
+ var a;
131
134
  return [
132
- d("button", Q, [
133
- d("span", R, B(L(e.composition)), 1),
134
- d("span", X, B(((i = O.value) == null ? void 0 : i.label) || "Schema"), 1),
135
- b(v(J), { class: "z-1" })
135
+ d("button", J, [
136
+ d("span", K, w(B(e.composition)), 1),
137
+ d("span", P, w(((a = O.value) == null ? void 0 : a.label) || "Schema"), 1),
138
+ b(v(R), { class: "z-1" })
136
139
  ])
137
140
  ];
138
141
  }),
139
142
  _: 1
140
143
  }, 8, ["modelValue", "options"]),
141
- d("div", Y, [
142
- (n = a.value) != null && n.description ? (s(), u("div", W, [
143
- b(v(G), {
144
- value: a.value.description
144
+ d("div", Q, [
145
+ (n = i.value) != null && n.description ? (m(), u("div", X, [
146
+ b(v($), {
147
+ value: i.value.description
145
148
  }, null, 8, ["value"])
146
149
  ])) : p("", !0),
147
- (r = a.value) != null && r.properties || (c = a.value) != null && c.type || (V = a.value) != null && V.nullable ? (s(), f(S, {
150
+ z.value ? (m(), f(S, {
148
151
  key: 1,
149
152
  compact: e.compact,
150
153
  level: e.level + 1,
@@ -152,12 +155,13 @@ const P = { class: "property-rule" }, Q = {
152
155
  name: e.name,
153
156
  noncollapsible: !0,
154
157
  schemas: e.schemas,
155
- value: (H = a.value) != null && H.properties ? {
158
+ value: (r = i.value) != null && r.properties ? {
156
159
  type: "object",
157
- properties: a.value.properties
158
- } : a.value
160
+ properties: i.value.properties,
161
+ required: i.value.required
162
+ } : i.value
159
163
  }, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : p("", !0),
160
- (w = a.value) != null && w.oneOf || (j = a.value) != null && j.anyOf ? (s(), f(t, {
164
+ (c = i.value) != null && c.oneOf || (V = i.value) != null && V.anyOf ? (m(), f(t, {
161
165
  key: 2,
162
166
  compact: e.compact,
163
167
  composition: h.value,
@@ -167,23 +171,23 @@ const P = { class: "property-rule" }, Q = {
167
171
  noncollapsible: !0,
168
172
  schemas: e.schemas,
169
173
  value: {
170
- [h.value]: U.value
174
+ [h.value]: T.value
171
175
  }
172
176
  }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : p("", !0)
173
177
  ])
174
- ], 64)) : (s(), f(S, {
178
+ ], 64)) : (m(), f(S, {
175
179
  key: 2,
176
180
  compact: e.compact,
177
181
  level: e.level,
178
182
  name: e.name,
179
183
  noncollapsible: e.level == 0,
180
184
  schemas: e.schemas,
181
- value: v(K)(e.value[e.composition])
185
+ value: v(Z)(e.value[e.composition])
182
186
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
183
187
  ]);
184
188
  };
185
189
  }
186
190
  });
187
191
  export {
188
- ae as default
192
+ te as default
189
193
  };
@@ -2,7 +2,7 @@ import { defineComponent as c, computed as n, createBlock as u, openBlock as b,
2
2
  import { ScalarListbox as x } from "@scalar/components";
3
3
  import { ScalarIconCaretDown as g } from "@scalar/icons";
4
4
  const v = {
5
- class: "bg-b-1.5 hover:bg-b-2 py-1.25 flex w-full items-center gap-1 border-b px-2",
5
+ class: "bg-b-1.5 hover:bg-b-2 flex w-full items-center gap-1 border-b px-2 py-1.25",
6
6
  type: "button"
7
7
  }, y = { class: "composition-selector-label text-c-1 relative" }, _ = /* @__PURE__ */ c({
8
8
  __name: "SchemaDiscriminator",
@@ -1,6 +1,6 @@
1
- import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
2
  type __VLS_Props = {
3
- value: OpenAPIV2.DefinitionsObject | OpenAPIV3.SchemaObject | OpenAPIV3.ArraySchemaObject | OpenAPIV3.NonArraySchemaObject | OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject;
3
+ value: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject;
4
4
  name?: string;
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAI9E,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAgFF,wBAMG"}
1
+ {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAIxD,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAgFF,wBAMG"}