@scalar/api-reference 1.35.2 → 1.35.3

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 (165) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/browser/standalone.js +9896 -10062
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts +2 -1
  5. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReference.vue.js +14 -11
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  9. package/dist/components/ApiReferenceLayout.vue2.js +70 -72
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +3 -1
  11. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Content.vue.d.ts +0 -2
  13. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Content.vue.js +80 -80
  15. package/dist/components/Content/Models/ClassicLayout.vue.d.ts +5 -2
  16. package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Models/ClassicLayout.vue.js +2 -2
  18. package/dist/components/Content/Models/ClassicLayout.vue2.js +43 -45
  19. package/dist/components/Content/Models/ClassicLayout.vue3.js +2 -2
  20. package/dist/components/Content/Models/Models.vue.d.ts +2 -2
  21. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  22. package/dist/components/Content/Models/Models.vue.js +27 -20
  23. package/dist/components/Content/Models/ModernLayout.vue.d.ts +5 -2
  24. package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
  26. package/dist/components/Content/Models/ModernLayout.vue2.js +48 -52
  27. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +3 -2
  28. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  29. package/dist/components/Content/Operations/TraversedEntry.vue.js +33 -32
  30. package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts +2 -2
  31. package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
  32. package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +1 -1
  33. package/dist/components/Content/Schema/Schema.vue.d.ts +6 -22
  34. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  35. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  36. package/dist/components/Content/Schema/Schema.vue2.js +86 -140
  37. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +15 -4
  38. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  39. package/dist/components/Content/Schema/SchemaComposition.vue.js +77 -138
  40. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +2 -13
  41. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
  42. package/dist/components/Content/Schema/SchemaEnumValues.vue.js +2 -2
  43. package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +66 -92
  44. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
  45. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  46. package/dist/components/Content/Schema/SchemaHeading.vue.js +2 -2
  47. package/dist/components/Content/Schema/SchemaHeading.vue2.js +19 -17
  48. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +5 -14
  49. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  50. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +47 -68
  51. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -13
  52. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  53. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  54. package/dist/components/Content/Schema/SchemaProperty.vue2.js +116 -144
  55. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts +1 -1
  56. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  57. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +2 -2
  58. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +9 -4
  59. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  60. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  61. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +173 -204
  62. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts +11 -0
  63. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -0
  64. package/dist/components/Content/Schema/helpers/get-ref-name.js +11 -0
  65. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +13 -3
  66. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -1
  67. package/dist/components/Content/Schema/helpers/get-schema-type.js +34 -13
  68. package/dist/components/Content/Schema/helpers/is-type-object.d.ts +4 -2
  69. package/dist/components/Content/Schema/helpers/is-type-object.d.ts.map +1 -1
  70. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -4
  71. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  72. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +130 -84
  73. package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts +5 -5
  74. package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -1
  75. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +40 -31
  76. package/dist/components/Content/Schema/helpers/schema-composition.d.ts +0 -8
  77. package/dist/components/Content/Schema/helpers/schema-composition.d.ts.map +1 -1
  78. package/dist/components/Content/Schema/helpers/schema-composition.js +2 -6
  79. package/dist/components/Content/Schema/helpers/schema-name.d.ts +8 -17
  80. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  81. package/dist/components/Content/Schema/helpers/schema-name.js +24 -33
  82. package/dist/features/Operation/Operation.vue.d.ts +3 -4
  83. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  84. package/dist/features/Operation/Operation.vue.js +54 -73
  85. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +10 -11
  86. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  87. package/dist/features/Operation/components/ContentTypeSelect.vue.js +35 -43
  88. package/dist/features/Operation/components/{ParameterHeaders.vue.d.ts → Header.vue.d.ts} +4 -5
  89. package/dist/features/Operation/components/Header.vue.d.ts.map +1 -0
  90. package/dist/features/Operation/components/Header.vue.js +23 -0
  91. package/dist/features/Operation/components/Header.vue2.js +4 -0
  92. package/dist/features/Operation/components/Headers.vue.d.ts +8 -0
  93. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -0
  94. package/dist/features/Operation/components/Headers.vue.js +7 -0
  95. package/dist/features/Operation/components/Headers.vue2.js +61 -0
  96. package/dist/features/Operation/components/OperationParameters.vue.d.ts +4 -10
  97. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  98. package/dist/features/Operation/components/OperationParameters.vue.js +23 -33
  99. package/dist/features/Operation/components/OperationResponses.vue.d.ts +3 -6
  100. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  101. package/dist/features/Operation/components/OperationResponses.vue.js +22 -19
  102. package/dist/features/Operation/components/ParameterList.vue.d.ts +3 -10
  103. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  104. package/dist/features/Operation/components/ParameterList.vue.js +35 -5
  105. package/dist/features/Operation/components/ParameterList.vue2.js +2 -38
  106. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +4 -10
  107. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  108. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  109. package/dist/features/Operation/components/ParameterListItem.vue2.js +77 -74
  110. package/dist/features/Operation/components/RequestBody.vue.d.ts +3 -8
  111. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  112. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  113. package/dist/features/Operation/components/RequestBody.vue2.js +75 -82
  114. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +0 -4
  115. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  116. package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
  117. package/dist/features/Operation/components/callbacks/Callback.vue2.js +35 -36
  118. package/dist/features/Operation/components/callbacks/Callback.vue3.js +2 -2
  119. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +0 -2
  120. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  121. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +13 -15
  122. package/dist/features/Operation/helpers/combine-params.d.ts +1 -1
  123. package/dist/features/Operation/helpers/combine-params.d.ts.map +1 -1
  124. package/dist/features/Operation/helpers/combine-params.js +2 -2
  125. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -9
  126. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  127. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  128. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +75 -82
  129. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -10
  130. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  131. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  132. package/dist/features/Operation/layouts/ModernLayout.vue2.js +96 -103
  133. package/dist/index.js +1 -1
  134. package/dist/libs/openapi.d.ts +1 -13
  135. package/dist/libs/openapi.d.ts.map +1 -1
  136. package/dist/libs/openapi.js +39 -56
  137. package/dist/style.css +1 -1
  138. package/dist/v2/ApiReferenceWorkspace.vue.d.ts +10 -4
  139. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  140. package/dist/v2/ApiReferenceWorkspace.vue.js +22 -18
  141. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +1 -1
  142. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  143. package/package.json +12 -12
  144. package/dist/components/Content/Schema/Schema.preview.d.ts +0 -1078
  145. package/dist/components/Content/Schema/Schema.preview.d.ts.map +0 -1
  146. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +0 -12
  147. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +0 -1
  148. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +0 -49
  149. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +0 -4
  150. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +0 -13
  151. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +0 -1
  152. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +0 -1
  153. package/dist/features/Operation/components/ParameterHeaders.vue.js +0 -7
  154. package/dist/features/Operation/components/ParameterHeaders.vue2.js +0 -64
  155. package/dist/features/Operation/components/ParameterList.vue3.js +0 -4
  156. package/dist/features/Operation/hooks/useResponses.d.ts +0 -17
  157. package/dist/features/Operation/hooks/useResponses.d.ts.map +0 -1
  158. package/dist/features/Operation/hooks/useResponses.js +0 -19
  159. package/dist/hooks/useDiscriminator.d.ts +0 -53
  160. package/dist/hooks/useDiscriminator.d.ts.map +0 -1
  161. package/dist/hooks/useDiscriminator.js +0 -149
  162. package/dist/hooks/useOperationDiscriminator.d.ts +0 -8
  163. package/dist/hooks/useOperationDiscriminator.d.ts.map +0 -1
  164. package/dist/hooks/useOperationDiscriminator.js +0 -57
  165. /package/dist/features/Operation/components/{ParameterHeaders.vue3.js → Headers.vue3.js} +0 -0
@@ -1,23 +1,21 @@
1
- import { defineComponent as I, inject as E, computed as u, createBlock as c, createCommentVNode as d, openBlock as i, unref as s, withCtx as p, createElementVNode as C, normalizeClass as v, createElementBlock as m, createVNode as h, withDirectives as w, createTextVNode as f, toDisplayString as g, vShow as R, normalizeStyle as $, Fragment as y } from "vue";
2
- import { Disclosure as U, DisclosureButton as T, DisclosurePanel as X } from "@headlessui/vue";
3
- import { ScalarMarkdown as G, ScalarIcon as b } from "@scalar/components";
4
- import j from "../../ScreenReader.vue.js";
5
- import { useConfig as J } from "../../../hooks/useConfig.js";
6
- import { DISCRIMINATOR_CONTEXT as K } from "../../../hooks/useDiscriminator.js";
7
- import { isTypeObject as P } from "./helpers/is-type-object.js";
8
- import L from "./SchemaHeading.vue.js";
9
- import Q from "./SchemaObjectProperties.vue.js";
10
- import Y from "./SchemaProperty.vue.js";
11
- const Z = {
1
+ import { defineComponent as M, computed as C, createBlock as s, createCommentVNode as c, openBlock as l, unref as i, withCtx as r, createElementVNode as N, normalizeClass as d, createElementBlock as o, createVNode as m, withDirectives as B, createTextVNode as h, toDisplayString as f, vShow as H, normalizeStyle as w, Fragment as u } from "vue";
2
+ import { Disclosure as D, DisclosureButton as O, DisclosurePanel as z } from "@headlessui/vue";
3
+ import { ScalarMarkdown as A, ScalarIcon as p } from "@scalar/components";
4
+ import P from "../../ScreenReader.vue.js";
5
+ import { isTypeObject as V } from "./helpers/is-type-object.js";
6
+ import j from "./SchemaHeading.vue.js";
7
+ import T from "./SchemaObjectProperties.vue.js";
8
+ import $ from "./SchemaProperty.vue.js";
9
+ const E = {
12
10
  key: 0,
13
11
  class: "schema-card-description"
14
- }, W = {
12
+ }, R = {
15
13
  key: 0,
16
14
  class: "schema-properties"
17
- }, ne = /* @__PURE__ */ I({
15
+ }, U = /* @__PURE__ */ M({
18
16
  __name: "Schema",
19
17
  props: {
20
- value: { type: [Object, Boolean] },
18
+ schema: {},
21
19
  level: { default: 0 },
22
20
  name: {},
23
21
  compact: { type: Boolean },
@@ -25,193 +23,141 @@ const Z = {
25
23
  hideHeading: { type: Boolean },
26
24
  additionalProperties: { type: Boolean },
27
25
  hideModelNames: { type: Boolean, default: !1 },
28
- schemas: {},
29
26
  discriminator: {},
30
- discriminatorMapping: {},
31
- discriminatorPropertyName: {},
32
- hasDiscriminator: { type: Boolean },
33
27
  breadcrumb: {}
34
28
  },
35
- emits: ["update:modelValue"],
36
- setup(z, { emit: q }) {
37
- const l = z, F = q, k = J(), o = E(K, null), N = u(
38
- () => {
39
- var e;
40
- return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.discriminatorMapping) || l.discriminatorMapping || {};
41
- }
42
- ), S = u(
43
- () => {
44
- var e;
45
- return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.discriminatorPropertyName) || l.discriminatorPropertyName || "";
46
- }
47
- ), M = u(
48
- () => {
49
- var e;
50
- return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.selectedType) || l.discriminator;
51
- }
52
- ), a = u(() => {
53
- var r;
54
- const e = (r = o == null ? void 0 : o.value) == null ? void 0 : r.mergedSchema, n = l.value;
55
- return e && l.level === 0 && l.hasDiscriminator && P(n) && P(e) ? e : l.value;
56
- }), B = u(() => !(l.noncollapsible || l.level === 0)), D = u(() => {
29
+ setup(a) {
30
+ const v = C(() => !a.noncollapsible && a.level > 0), y = C(() => {
57
31
  var e, n;
58
- if ((e = a.value) != null && e.allOf && Array.isArray(a.value.allOf) && // Because we don't want it to show in models
59
- l.name === "Request Body") {
60
- if (a.value.description)
61
- return a.value.description;
62
- const r = a.value.allOf.find(
63
- (t) => t.description && typeof t.description == "string"
64
- );
65
- if (r != null && r.description)
66
- return r.description;
67
- }
68
- return !((n = a.value) != null && n.description) || typeof a.value.description != "string" || a.value.oneOf || a.value.anyOf || a.value.enum || !a.value.properties && !a.value.patternProperties && !a.value.additionalProperties || l.level === 0 ? null : a.value.description;
69
- }), O = (e) => l.noncollapsible && e.stopPropagation(), H = (e) => {
70
- F("update:modelValue", e);
71
- };
72
- return (e, n) => typeof e.value == "object" && Object.keys(e.value).length ? (i(), c(s(U), {
32
+ return (e = a.schema) != null && e.allOf && a.schema.allOf.length > 0 && a.name === "Request Body" ? a.schema.description || a.schema.allOf[0].description : !((n = a.schema) != null && n.description) || typeof a.schema.description != "string" || a.schema.oneOf || a.schema.anyOf || a.schema.enum || !("properties" in a.schema) && !("patternProperties" in a.schema) && !("additionalProperties" in a.schema) ? null : a.schema.description;
33
+ }), b = (e) => a.noncollapsible && e.stopPropagation();
34
+ return (e, n) => typeof e.schema == "object" && Object.keys(e.schema).length ? (l(), s(i(D), {
73
35
  key: 0,
74
36
  defaultOpen: e.noncollapsible
75
37
  }, {
76
- default: p(({ open: r }) => [
77
- C("div", {
78
- class: v(["schema-card", [
38
+ default: r(({ open: t }) => [
39
+ N("div", {
40
+ class: d(["schema-card", [
79
41
  `schema-card--level-${e.level}`,
80
- { "schema-card--compact": e.compact, "schema-card--open": r },
81
- { "border-t": e.additionalProperties && r }
42
+ { "schema-card--compact": e.compact, "schema-card--open": t },
43
+ { "border-t": e.additionalProperties && t }
82
44
  ]])
83
45
  }, [
84
- D.value ? (i(), m("div", Z, [
85
- h(s(G), { value: D.value }, null, 8, ["value"])
86
- ])) : d("", !0),
87
- C("div", {
88
- class: v(["schema-properties", {
89
- "schema-properties-open": r
46
+ y.value ? (l(), o("div", E, [
47
+ m(i(A), { value: y.value }, null, 8, ["value"])
48
+ ])) : c("", !0),
49
+ N("div", {
50
+ class: d(["schema-properties", {
51
+ "schema-properties-open": t
90
52
  }])
91
53
  }, [
92
- e.additionalProperties ? w((i(), m("div", W, [
93
- h(s(T), {
54
+ e.additionalProperties ? B((l(), o("div", R, [
55
+ m(i(O), {
94
56
  as: "button",
95
57
  class: "schema-card-title schema-card-title--compact",
96
- onClickCapture: O
58
+ onClickCapture: b
97
59
  }, {
98
- default: p(() => [
99
- h(s(b), {
60
+ default: r(() => [
61
+ m(i(p), {
100
62
  class: "schema-card-title-icon",
101
63
  icon: "Add",
102
64
  size: "sm"
103
65
  }),
104
- n[0] || (n[0] = f(" Show additional properties ")),
105
- e.name ? (i(), c(j, { key: 0 }, {
106
- default: p(() => [
107
- f("for " + g(e.name), 1)
66
+ n[0] || (n[0] = h(" Show additional properties ")),
67
+ e.name ? (l(), s(P, { key: 0 }, {
68
+ default: r(() => [
69
+ h("for " + f(e.name), 1)
108
70
  ]),
109
71
  _: 1
110
- })) : d("", !0)
72
+ })) : c("", !0)
111
73
  ]),
112
74
  _: 1,
113
75
  __: [0]
114
76
  })
115
77
  ], 512)), [
116
- [R, !r]
117
- ]) : B.value ? w((i(), c(s(T), {
78
+ [H, !t]
79
+ ]) : v.value ? B((l(), s(i(O), {
118
80
  key: 1,
119
81
  as: e.noncollapsible ? "div" : "button",
120
- class: v(["schema-card-title", { "schema-card-title--compact": e.compact }]),
121
- style: $({
82
+ class: d(["schema-card-title", { "schema-card-title--compact": e.compact }]),
83
+ style: w({
122
84
  top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
123
85
  }),
124
- onClickCapture: O
86
+ onClickCapture: b
125
87
  }, {
126
- default: p(() => {
127
- var t, V, A;
88
+ default: r(() => {
89
+ var k, g, S;
128
90
  return [
129
- e.compact ? (i(), m(y, { key: 0 }, [
130
- h(s(b), {
131
- class: v(["schema-card-title-icon", { "schema-card-title-icon--open": r }]),
91
+ e.compact ? (l(), o(u, { key: 0 }, [
92
+ m(i(p), {
93
+ class: d(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
132
94
  icon: "Add",
133
95
  size: "sm"
134
96
  }, null, 8, ["class"]),
135
- r ? (i(), m(y, { key: 0 }, [
136
- f(" Hide " + g(((t = e.value) == null ? void 0 : t.title) ?? "Child Attributes"), 1)
137
- ], 64)) : (i(), m(y, { key: 1 }, [
138
- f(" Show " + g(((V = e.value) == null ? void 0 : V.title) ?? "Child Attributes"), 1)
97
+ t ? (l(), o(u, { key: 0 }, [
98
+ h(" Hide " + f(((k = e.schema) == null ? void 0 : k.title) ?? "Child Attributes"), 1)
99
+ ], 64)) : (l(), o(u, { key: 1 }, [
100
+ h(" Show " + f(((g = e.schema) == null ? void 0 : g.title) ?? "Child Attributes"), 1)
139
101
  ], 64)),
140
- e.name ? (i(), c(j, { key: 2 }, {
141
- default: p(() => [
142
- f("for " + g(e.name), 1)
102
+ e.name ? (l(), s(P, { key: 2 }, {
103
+ default: r(() => [
104
+ h("for " + f(e.name), 1)
143
105
  ]),
144
106
  _: 1
145
- })) : d("", !0)
146
- ], 64)) : (i(), m(y, { key: 1 }, [
147
- h(s(b), {
148
- class: v(["schema-card-title-icon", { "schema-card-title-icon--open": r }]),
107
+ })) : c("", !0)
108
+ ], 64)) : (l(), o(u, { key: 1 }, [
109
+ m(i(p), {
110
+ class: d(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
149
111
  icon: "Add",
150
112
  size: "sm"
151
113
  }, null, 8, ["class"]),
152
- h(L, {
153
- name: ((A = e.value) == null ? void 0 : A.title) ?? e.name,
154
- value: e.value
114
+ m(j, {
115
+ name: ((S = e.schema) == null ? void 0 : S.title) ?? e.name,
116
+ value: e.schema
155
117
  }, null, 8, ["name", "value"])
156
118
  ], 64))
157
119
  ];
158
120
  }),
159
121
  _: 2
160
122
  }, 1032, ["as", "class", "style"])), [
161
- [R, !e.hideHeading && !(e.noncollapsible && e.compact)]
162
- ]) : d("", !0),
163
- !e.additionalProperties || r ? (i(), c(s(X), {
123
+ [H, !e.hideHeading && !(e.noncollapsible && e.compact)]
124
+ ]) : c("", !0),
125
+ !e.additionalProperties || t ? (l(), s(i(z), {
164
126
  key: 2,
165
127
  as: "ul",
166
- static: !B.value
128
+ static: !v.value
167
129
  }, {
168
- default: p(() => {
169
- var t;
170
- return [
171
- s(P)(a.value) ? (i(), c(Q, {
130
+ default: r(() => [
131
+ i(V)(e.schema) ? (l(), s(T, {
132
+ key: 0,
133
+ breadcrumb: e.breadcrumb,
134
+ compact: e.compact,
135
+ discriminator: e.discriminator,
136
+ hideHeading: e.hideHeading,
137
+ hideModelNames: e.hideModelNames,
138
+ level: e.level + 1,
139
+ schema: e.schema
140
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "schema"])) : (l(), o(u, { key: 1 }, [
141
+ e.schema ? (l(), s($, {
172
142
  key: 0,
173
143
  breadcrumb: e.breadcrumb,
174
144
  compact: e.compact,
175
- discriminator: M.value,
176
- discriminatorMapping: N.value,
177
- discriminatorPropertyName: S.value,
178
- hasDiscriminator: e.hasDiscriminator,
179
145
  hideHeading: e.hideHeading,
180
146
  hideModelNames: e.hideModelNames,
181
- level: e.level + 1,
182
- orderRequiredPropertiesFirst: s(k).orderRequiredPropertiesFirst,
183
- orderSchemaPropertiesBy: s(k).orderSchemaPropertiesBy,
184
- schema: a.value,
185
- schemas: e.schemas,
186
- "onUpdate:modelValue": H
187
- }, null, 8, ["breadcrumb", "compact", "discriminator", "discriminatorMapping", "discriminatorPropertyName", "hasDiscriminator", "hideHeading", "hideModelNames", "level", "orderRequiredPropertiesFirst", "orderSchemaPropertiesBy", "schema", "schemas"])) : (i(), m(y, { key: 1 }, [
188
- a.value ? (i(), c(Y, {
189
- key: 0,
190
- breadcrumb: e.breadcrumb,
191
- compact: e.compact,
192
- discriminatorMapping: N.value,
193
- discriminatorPropertyName: S.value,
194
- hideHeading: e.hideHeading,
195
- hideModelNames: e.hideModelNames,
196
- level: e.level,
197
- modelValue: M.value,
198
- name: a.value.name,
199
- schemas: e.schemas,
200
- value: ((t = e.value.discriminator) == null ? void 0 : t.propertyName) === e.name ? e.value : a.value,
201
- "onUpdate:modelValue": H
202
- }, null, 8, ["breadcrumb", "compact", "discriminatorMapping", "discriminatorPropertyName", "hideHeading", "hideModelNames", "level", "modelValue", "name", "schemas", "value"])) : d("", !0)
203
- ], 64))
204
- ];
205
- }),
147
+ level: e.level,
148
+ value: e.schema
149
+ }, null, 8, ["breadcrumb", "compact", "hideHeading", "hideModelNames", "level", "value"])) : c("", !0)
150
+ ], 64))
151
+ ]),
206
152
  _: 1
207
- }, 8, ["static"])) : d("", !0)
153
+ }, 8, ["static"])) : c("", !0)
208
154
  ], 2)
209
155
  ], 2)
210
156
  ]),
211
157
  _: 1
212
- }, 8, ["defaultOpen"])) : d("", !0);
158
+ }, 8, ["defaultOpen"])) : c("", !0);
213
159
  }
214
160
  });
215
161
  export {
216
- ne as default
162
+ U as default
217
163
  };
@@ -1,15 +1,26 @@
1
- import type { Schemas } from '../../../features/Operation/types/schemas';
1
+ import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
2
  import { type CompositionKeyword } from './helpers/schema-composition.js';
3
3
  type __VLS_Props = {
4
+ /** The composition keyword (oneOf, anyOf, allOf) */
4
5
  composition: CompositionKeyword;
5
- schemas?: Schemas;
6
+ /** Optional discriminator object for polymorphic schemas */
7
+ discriminator?: DiscriminatorObject;
8
+ /** Optional name for the schema */
6
9
  name?: string;
7
- value: Record<string, any>;
10
+ /** The schema value containing the composition */
11
+ value: SchemaObject;
12
+ /** Nesting level for proper indentation */
8
13
  level: number;
14
+ /** Whether to use compact layout */
9
15
  compact?: boolean;
16
+ /** Whether to hide the heading */
10
17
  hideHeading?: boolean;
18
+ /** Breadcrumb for navigation */
11
19
  breadcrumb?: string[];
12
20
  };
13
- 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>;
21
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
22
+ compact: boolean;
23
+ hideHeading: boolean;
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
25
  export default _default;
15
26
  //# sourceMappingURL=SchemaComposition.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAoQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAIjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAGrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,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;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;AAgXF,wBAMG"}
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAgJA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGtE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,KAAK,EAAE,YAAY,CAAA;IACnB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;aALU,OAAO;iBAEH,OAAO;;AAmNzB,wBAOG"}
@@ -1,152 +1,91 @@
1
- import { defineComponent as z, ref as E, computed as t, resolveComponent as j, createElementBlock as v, openBlock as i, createCommentVNode as b, createBlock as c, Fragment as A, renderList as F, createVNode as H, createElementVNode as u, unref as O, withCtx as R, toDisplayString as N } from "vue";
2
- import { ScalarListbox as Z } from "@scalar/components";
3
- import { ScalarIconCaretDown as $ } from "@scalar/icons";
4
- import { getSchemaType as G } from "./helpers/get-schema-type.js";
5
- import { mergeAllOfSchemas as V } from "./helpers/merge-all-of-schemas.js";
6
- import { hasComposition as h } from "./helpers/schema-composition.js";
7
- import y from "./Schema.vue.js";
8
- const J = { class: "property-rule" }, K = {
1
+ import { defineComponent as C, computed as m, ref as S, createElementBlock as s, openBlock as r, createBlock as H, unref as c, Fragment as k, createVNode as p, createElementVNode as i, withCtx as V, createCommentVNode as w, toDisplayString as f, normalizeClass as B } from "vue";
2
+ import { ScalarListbox as N } from "@scalar/components";
3
+ import { isDefined as O } from "@scalar/helpers/array/is-defined";
4
+ import { ScalarIconCaretDown as z } from "@scalar/icons";
5
+ import { getResolvedRef as D } from "@scalar/workspace-store/helpers/get-resolved-ref";
6
+ import { getSchemaType as U } from "./helpers/get-schema-type.js";
7
+ import { mergeAllOfSchemas as _ } from "./helpers/merge-all-of-schemas.js";
8
+ import h from "./Schema.vue.js";
9
+ const A = { class: "property-rule" }, E = {
9
10
  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
11
  type: "button"
11
- }, M = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1" }, Q = { class: "composition-panel" }, ae = /* @__PURE__ */ z({
12
+ }, L = { class: "text-c-2" }, R = {
13
+ key: 0,
14
+ class: "text-red"
15
+ }, T = { class: "composition-panel" }, K = /* @__PURE__ */ C({
12
16
  __name: "SchemaComposition",
13
17
  props: {
14
18
  composition: {},
15
- schemas: {},
19
+ discriminator: {},
16
20
  name: {},
17
21
  value: {},
18
22
  level: {},
19
- compact: { type: Boolean },
20
- hideHeading: { type: Boolean },
23
+ compact: { type: Boolean, default: !1 },
24
+ hideHeading: { type: Boolean, default: !1 },
21
25
  breadcrumb: {}
22
26
  },
23
- setup(r) {
24
- const p = E(0), w = t(() => S.value), g = t(
25
- () => w.value.map(
26
- (e, o) => ({
27
- id: String(o),
28
- label: G(e) || "Schema"
29
- })
30
- )
31
- ), d = t({
32
- get: () => g.value.find(
33
- (e) => e.id === String(p.value)
34
- ),
35
- set: (e) => p.value = Number(e.id)
36
- }), B = t(() => {
37
- var s;
38
- const e = ["oneOf", "anyOf"].includes(r.composition), o = r.composition === "allOf" && ((s = r.value[r.composition]) == null ? void 0 : s.some((a) => h(a)));
39
- return e || o;
40
- }), D = (e) => e.find((o) => h(o)), I = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
41
- (o) => o.oneOf || o.anyOf || o.allOf
42
- ), C = (e) => e.allOf && Array.isArray(e.allOf) ? I(e) ? e : V(e.allOf) : e, S = t(() => {
43
- const e = r.value[r.composition], o = D(e);
44
- return !o || r.composition !== "allOf" && o.allOf ? e.map(C) : (o.oneOf || o.anyOf || o.allOf).map(C);
45
- }), L = (e) => {
46
- var o, s;
47
- if (e === "allOf") {
48
- const a = (s = (o = r.value) == null ? void 0 : o[e]) == null ? void 0 : s.find(
49
- (m) => h(m)
50
- );
51
- if (a != null && a.oneOf)
52
- return "One of";
53
- if (a != null && a.anyOf)
54
- return "Any of";
55
- }
56
- return e.replace(/([A-Z])/g, " $1").replace(/^./, (a) => a.toUpperCase()).toLowerCase().replace(/^(\w)/, (a) => a.toUpperCase());
57
- }, n = t(
58
- () => S.value[p.value]
59
- ), f = t(() => {
60
- var e;
61
- return (e = n.value) != null && e.oneOf ? "oneOf" : "anyOf";
62
- }), T = t(() => {
63
- var o;
64
- const e = f.value;
65
- return (o = n.value) == null ? void 0 : o[e];
66
- }), U = t(() => {
67
- const e = n.value;
68
- return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
69
- });
70
- return (e, o) => {
71
- var a, m, k;
72
- const s = j("SchemaComposition", !0);
73
- return i(), v("div", J, [
74
- e.composition === "allOf" && e.value[e.composition].some((l) => l.oneOf || l.anyOf) ? (i(!0), v(A, { key: 0 }, F(e.value[e.composition].filter(
75
- (l) => !l.oneOf && !l.anyOf
76
- ), (l, q) => (i(), c(y, {
77
- key: q,
78
- breadcrumb: e.breadcrumb,
79
- compact: e.compact,
80
- level: e.level,
81
- name: e.name,
82
- noncollapsible: e.level == 0,
83
- schemas: e.schemas,
84
- value: l
85
- }, null, 8, ["breadcrumb", "compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : b("", !0),
86
- B.value ? (i(), v(A, { key: 1 }, [
87
- H(O(Z), {
88
- modelValue: d.value,
89
- "onUpdate:modelValue": o[0] || (o[0] = (l) => d.value = l),
90
- options: g.value,
91
- resize: ""
92
- }, {
93
- default: R(() => {
94
- var l;
95
- return [
96
- u("button", K, [
97
- u("span", M, N(L(e.composition)), 1),
98
- u("span", P, N(((l = d.value) == null ? void 0 : l.label) || "Schema"), 1),
99
- H(O($))
100
- ])
101
- ];
102
- }),
103
- _: 1
104
- }, 8, ["modelValue", "options"]),
105
- u("div", Q, [
106
- U.value ? (i(), c(y, {
107
- key: 0,
108
- breadcrumb: e.breadcrumb,
109
- compact: e.compact,
110
- level: e.level + 1,
111
- hideHeading: e.hideHeading,
112
- name: e.name,
113
- noncollapsible: !0,
114
- schemas: e.schemas,
115
- value: (a = n.value) != null && a.properties ? {
116
- type: "object",
117
- properties: n.value.properties,
118
- required: n.value.required
119
- } : n.value
120
- }, null, 8, ["breadcrumb", "compact", "level", "hideHeading", "name", "schemas", "value"])) : b("", !0),
121
- (m = n.value) != null && m.oneOf || (k = n.value) != null && k.anyOf ? (i(), c(s, {
122
- key: 1,
123
- breadcrumb: e.breadcrumb,
124
- compact: e.compact,
125
- composition: f.value,
126
- hideHeading: e.hideHeading,
127
- level: e.level + 1,
128
- name: e.name,
129
- noncollapsible: !0,
130
- schemas: e.schemas,
131
- value: {
132
- [f.value]: T.value
133
- }
134
- }, null, 8, ["breadcrumb", "compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : b("", !0)
135
- ])
136
- ], 64)) : (i(), c(y, {
137
- key: 2,
138
- breadcrumb: e.breadcrumb,
139
- compact: e.compact,
140
- level: e.level,
141
- name: e.name,
142
- noncollapsible: e.level == 0,
143
- schemas: e.schemas,
144
- value: O(V)(e.value[e.composition])
145
- }, null, 8, ["breadcrumb", "compact", "level", "name", "noncollapsible", "schemas", "value"]))
146
- ]);
147
- };
27
+ setup(g) {
28
+ const a = g, d = m(
29
+ () => [a.value[a.composition]].flat().map((e) => ({ value: D(e), original: e })).filter((e) => O(e.value))
30
+ ), u = m(
31
+ () => d.value.map((e, o) => ({
32
+ id: String(o),
33
+ label: U(e.original) || "Schema"
34
+ }))
35
+ ), t = S(u.value[0]), y = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (o) => o.toUpperCase()).toLowerCase().replace(/^(\w)/, (o) => o.toUpperCase()), n = m(
36
+ () => d.value[Number(t.value.id)].value
37
+ );
38
+ return (e, o) => (r(), s("div", A, [
39
+ a.composition === "allOf" ? (r(), H(h, {
40
+ key: 0,
41
+ breadcrumb: e.breadcrumb,
42
+ compact: e.compact,
43
+ discriminator: e.discriminator,
44
+ hideHeading: e.hideHeading,
45
+ level: e.level,
46
+ name: e.name,
47
+ noncollapsible: !0,
48
+ schema: c(_)(a.value)
49
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "level", "name", "schema"])) : (r(), s(k, { key: 1 }, [
50
+ p(c(N), {
51
+ modelValue: t.value,
52
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
53
+ options: u.value,
54
+ resize: ""
55
+ }, {
56
+ default: V(() => {
57
+ var l, b, v;
58
+ return [
59
+ i("button", E, [
60
+ i("span", L, f(y(a.composition)), 1),
61
+ i("span", {
62
+ class: B(["composition-selector-label text-c-1", {
63
+ "line-through": (l = n.value) == null ? void 0 : l.deprecated
64
+ }])
65
+ }, f(((b = t.value) == null ? void 0 : b.label) || "Schema"), 3),
66
+ (v = n.value) != null && v.deprecated ? (r(), s("div", R, " deprecated ")) : w("", !0),
67
+ p(c(z))
68
+ ])
69
+ ];
70
+ }),
71
+ _: 1
72
+ }, 8, ["modelValue", "options"]),
73
+ i("div", T, [
74
+ p(h, {
75
+ breadcrumb: e.breadcrumb,
76
+ compact: e.compact,
77
+ discriminator: e.discriminator,
78
+ hideHeading: e.hideHeading,
79
+ level: e.level + 1,
80
+ name: e.name,
81
+ noncollapsible: !0,
82
+ schema: n.value
83
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "level", "name", "schema"])
84
+ ])
85
+ ], 64))
86
+ ]));
148
87
  }
149
88
  });
150
89
  export {
151
- ae as default
90
+ K as default
152
91
  };
@@ -1,18 +1,7 @@
1
- type SchemaValue = {
2
- 'enum'?: any[];
3
- 'items'?: {
4
- enum?: any[];
5
- };
6
- 'x-enumDescriptions'?: Record<string, string> | string[];
7
- 'x-enum-descriptions'?: Record<string, string> | string[];
8
- 'x-enum-varnames'?: string[];
9
- 'x-enumNames'?: string[];
10
- } & Record<string, any>;
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
11
2
  type __VLS_Props = {
12
3
  /** The schema object containing enum values and metadata */
13
- value?: SchemaValue;
14
- /** Whether this enum is used as a discriminator property */
15
- isDiscriminator?: boolean;
4
+ value: SchemaObject | undefined;
16
5
  };
17
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>;
18
7
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEnumValues.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnumValues.vue"],"names":[],"mappings":"AA2PA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAA;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;IACxD,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;IACzD,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAGvB,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;AAuTF,wBAMG"}
1
+ {"version":3,"file":"SchemaEnumValues.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnumValues.vue"],"names":[],"mappings":"AAiLA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;CAChC,CAAC;;AA6OF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaEnumValues.vue2.js";
2
2
  import "./SchemaEnumValues.vue3.js";
3
3
  import m from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ m(o, [["__scopeId", "data-v-bf2bedb9"]]);
4
+ const e = /* @__PURE__ */ m(o, [["__scopeId", "data-v-d4946030"]]);
5
5
  export {
6
- r as default
6
+ e as default
7
7
  };