@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,270 +1,239 @@
1
- import { defineComponent as L, computed as C, createElementBlock as m, openBlock as r, createCommentVNode as a, createBlock as i, normalizeClass as $, renderSlot as T, Fragment as f, withCtx as u, createVNode as y, createTextVNode as l, toDisplayString as o, unref as s } from "vue";
2
- import { isDefined as p } from "@scalar/helpers/array/is-defined";
1
+ import { defineComponent as E, toRef as J, computed as f, createElementBlock as a, openBlock as i, createCommentVNode as l, createBlock as m, normalizeClass as F, renderSlot as j, Fragment as c, withCtx as n, createVNode as k, createTextVNode as u, toDisplayString as v, renderList as z, createSlots as H, unref as _ } from "vue";
2
+ import { isDefined as d } from "@scalar/helpers/array/is-defined";
3
+ import { getResolvedRef as I } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
+ import { isArraySchema as g, isStringSchema as L, isNumberSchema as R } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
3
5
  import S from "../../ScreenReader.vue.js";
4
- import { getDiscriminatorSchemaName as b } from "../../../hooks/useDiscriminator.js";
5
- import { getSchemaType as F } from "./helpers/get-schema-type.js";
6
- import { getModelName as J } from "./helpers/schema-name.js";
7
- import h from "./RenderString.vue.js";
8
- import n from "./SchemaPropertyDetail.vue.js";
9
- import z from "./SchemaPropertyExamples.vue.js";
10
- import H from "../../Badge/Badge.vue.js";
11
- const R = { class: "property-heading" }, j = {
6
+ import { getSchemaType as G } from "./helpers/get-schema-type.js";
7
+ import { getModelName as K } from "./helpers/schema-name.js";
8
+ import Q from "./RenderString.vue.js";
9
+ import p from "./SchemaPropertyDetail.vue.js";
10
+ import U from "./SchemaPropertyExamples.vue.js";
11
+ import W from "../../Badge/Badge.vue.js";
12
+ const X = { class: "property-heading" }, Y = {
12
13
  key: 1,
13
14
  class: "property-discriminator"
14
- }, G = {
15
+ }, Z = {
15
16
  key: 3,
16
17
  class: "property-additional"
17
- }, K = {
18
+ }, ee = {
18
19
  key: 4,
19
20
  class: "property-deprecated"
20
- }, Q = {
21
+ }, te = {
21
22
  key: 5,
22
23
  class: "property-const"
23
- }, U = {
24
+ }, re = {
24
25
  key: 7,
25
26
  class: "property-write-only"
26
- }, W = {
27
+ }, ie = {
27
28
  key: 8,
28
29
  class: "property-read-only"
29
- }, X = {
30
+ }, ae = {
30
31
  key: 9,
31
32
  class: "property-required"
32
- }, ae = /* @__PURE__ */ L({
33
+ }, ve = /* @__PURE__ */ E({
33
34
  __name: "SchemaPropertyHeading",
34
35
  props: {
35
36
  value: {},
36
37
  enum: { type: Boolean },
38
+ isDiscriminator: { type: Boolean, default: !1 },
37
39
  required: { type: Boolean, default: !1 },
38
40
  additional: { type: Boolean },
39
41
  withExamples: { type: Boolean, default: !0 },
40
- hideModelNames: { type: Boolean, default: !1 },
41
- schemas: {}
42
+ hideModelNames: { type: Boolean, default: !1 }
42
43
  },
43
- setup(d) {
44
- const E = (e) => (e == null ? void 0 : e.default) === null ? "null" : Array.isArray(e == null ? void 0 : e.default) && e.default.length === 1 ? e.default[0] : typeof (e == null ? void 0 : e.default) == "string" || Array.isArray(e == null ? void 0 : e.default) ? JSON.stringify(e.default) : e == null ? void 0 : e.default, B = C(() => {
45
- var e, t, v, k, g, N;
46
- if (((e = d.value) == null ? void 0 : e.const) !== void 0)
47
- return (t = d.value) == null ? void 0 : t.const;
48
- if (((k = (v = d.value) == null ? void 0 : v.enum) == null ? void 0 : k.length) === 1)
49
- return d.value.enum[0];
50
- if ((g = d.value) != null && g.items) {
51
- if (p(d.value.items.const))
52
- return d.value.items.const;
53
- if (((N = d.value.items.enum) == null ? void 0 : N.length) === 1)
54
- return d.value.items.enum[0];
44
+ setup(T) {
45
+ const r = T, x = J(r, "value"), h = f(() => {
46
+ var t, y;
47
+ if (!x.value)
48
+ return;
49
+ const e = x.value;
50
+ if (e.const !== void 0)
51
+ return e.const;
52
+ if (((t = e.enum) == null ? void 0 : t.length) === 1)
53
+ return e.enum[0];
54
+ if (g(e) && e.items) {
55
+ const s = I(e.items);
56
+ if (d(s.const))
57
+ return s.const;
58
+ if (((y = s.enum) == null ? void 0 : y.length) === 1)
59
+ return s.enum[0];
55
60
  }
56
- }), D = C(() => d.value ? J(
57
- d.value,
58
- d.schemas,
59
- d.hideModelNames,
60
- b
61
- ) : null);
61
+ }), V = f(() => {
62
+ if (!x.value)
63
+ return [];
64
+ const e = x.value, t = [];
65
+ return g(e) && ((e.minItems || e.maxItems) && t.push({
66
+ key: "array-range",
67
+ value: `${e.minItems || ""}…${e.maxItems || ""}`
68
+ }), e.uniqueItems && t.push({
69
+ key: "unique-items",
70
+ value: "unique!"
71
+ })), L(e) && (e.minLength && t.push({
72
+ key: "min-length",
73
+ prefix: "min length: ",
74
+ value: e.minLength
75
+ }), e.maxLength && t.push({
76
+ key: "max-length",
77
+ prefix: "max length: ",
78
+ value: e.maxLength
79
+ }), e.pattern && t.push({
80
+ key: "pattern",
81
+ value: e.pattern,
82
+ code: !0,
83
+ truncate: !0
84
+ })), (L(e) || R(e)) && e.format && t.push({
85
+ key: "format",
86
+ value: e.format,
87
+ truncate: !0
88
+ }), R(e) && (d(e.exclusiveMinimum) && t.push({
89
+ key: "exclusive-minimum",
90
+ prefix: "greater than: ",
91
+ value: e.exclusiveMinimum
92
+ }), d(e.minimum) && t.push({
93
+ key: "minimum",
94
+ prefix: "min: ",
95
+ value: e.minimum
96
+ }), d(e.exclusiveMaximum) && t.push({
97
+ key: "exclusive-maximum",
98
+ prefix: "less than: ",
99
+ value: e.exclusiveMaximum
100
+ }), d(e.maximum) && t.push({
101
+ key: "maximum",
102
+ prefix: "max: ",
103
+ value: e.maximum
104
+ }), d(e.multipleOf) && t.push({
105
+ key: "multiple-of",
106
+ prefix: "multiple of: ",
107
+ value: e.multipleOf
108
+ })), t;
109
+ }), $ = f(() => r.value ? K(r.value, r.hideModelNames) : null), b = f(() => !r.value || !("type" in r.value) ? !1 : r.value.type === "array" ? !0 : !h.value), C = f(() => r.value ? $.value || G(r.value) : ""), N = f(() => {
110
+ const e = r.value;
111
+ return (e == null ? void 0 : e.default) === null ? "null" : Array.isArray(e == null ? void 0 : e.default) && (e == null ? void 0 : e.default.length) === 1 ? String(e == null ? void 0 : e.default[0]) : typeof (e == null ? void 0 : e.default) == "string" ? JSON.stringify(e.default) : Array.isArray(e == null ? void 0 : e.default) || typeof (e == null ? void 0 : e.default) == "object" ? JSON.stringify(e == null ? void 0 : e.default) : e == null ? void 0 : e.default;
112
+ });
62
113
  return (e, t) => {
63
- var v, k, g, N, M, q, w, O, P, I, V, A;
64
- return r(), m("div", R, [
65
- e.$slots.name ? (r(), m("div", {
114
+ var y, s, B, q, w, D, M, O, P, A;
115
+ return i(), a("div", X, [
116
+ e.$slots.name ? (i(), a("div", {
66
117
  key: 0,
67
- class: $(["property-name", { deprecated: (v = e.value) == null ? void 0 : v.deprecated }])
118
+ class: F(["property-name", { deprecated: (y = r.value) == null ? void 0 : y.deprecated }])
68
119
  }, [
69
- T(e.$slots, "name", {}, void 0, !0)
70
- ], 2)) : a("", !0),
71
- (k = e.value) != null && k.isDiscriminator ? (r(), m("div", j, " Discriminator ")) : a("", !0),
72
- e.value ? (r(), m(f, { key: 2 }, [
73
- (g = e.value) != null && g.type ? (r(), i(n, {
120
+ j(e.$slots, "name", {}, void 0, !0)
121
+ ], 2)) : l("", !0),
122
+ r.isDiscriminator ? (i(), a("div", Y, " Discriminator ")) : l("", !0),
123
+ r.value ? (i(), a(c, { key: 2 }, [
124
+ b.value ? (i(), m(p, {
74
125
  key: 0,
75
126
  truncate: ""
76
127
  }, {
77
- default: u(() => [
78
- y(S, null, {
79
- default: u(() => t[0] || (t[0] = [
80
- l("Type: ")
128
+ default: n(() => [
129
+ k(S, null, {
130
+ default: n(() => t[0] || (t[0] = [
131
+ u("Type: ")
81
132
  ])),
82
133
  _: 1,
83
134
  __: [0]
84
135
  }),
85
- D.value ? (r(), m(f, { key: 0 }, [
86
- l(o(D.value), 1)
87
- ], 64)) : (r(), m(f, { key: 1 }, [
88
- l(o(s(F)(e.value)), 1)
89
- ], 64))
136
+ u(v(C.value), 1)
90
137
  ]),
91
138
  _: 1
92
- })) : a("", !0),
93
- e.value.minItems || e.value.maxItems ? (r(), i(n, { key: 1 }, {
94
- default: u(() => [
95
- l(o(e.value.minItems) + "…" + o(e.value.maxItems), 1)
96
- ]),
97
- _: 1
98
- })) : a("", !0),
99
- e.value.minLength ? (r(), i(n, { key: 2 }, {
100
- prefix: u(() => t[1] || (t[1] = [
101
- l("min length: ")
102
- ])),
103
- default: u(() => [
104
- l(" " + o(e.value.minLength), 1)
105
- ]),
106
- _: 1
107
- })) : a("", !0),
108
- e.value.maxLength ? (r(), i(n, { key: 3 }, {
109
- prefix: u(() => t[2] || (t[2] = [
110
- l("max length: ")
111
- ])),
112
- default: u(() => [
113
- l(" " + o(e.value.maxLength), 1)
114
- ]),
115
- _: 1
116
- })) : a("", !0),
117
- e.value.uniqueItems ? (r(), i(n, { key: 4 }, {
118
- default: u(() => t[3] || (t[3] = [
119
- l(" unique! ")
120
- ])),
121
- _: 1,
122
- __: [3]
123
- })) : a("", !0),
124
- e.value.format ? (r(), i(n, {
125
- key: 5,
126
- truncate: ""
127
- }, {
128
- default: u(() => [
129
- y(S, null, {
130
- default: u(() => t[4] || (t[4] = [
131
- l("Format:")
139
+ })) : l("", !0),
140
+ (i(!0), a(c, null, z(V.value, (o) => (i(), m(p, {
141
+ key: o.key,
142
+ code: o.code,
143
+ truncate: o.truncate
144
+ }, H({
145
+ default: n(() => [
146
+ o.key === "format" ? (i(), m(S, { key: 0 }, {
147
+ default: n(() => t[1] || (t[1] = [
148
+ u("Format:")
132
149
  ])),
133
150
  _: 1,
134
- __: [4]
135
- }),
136
- l(" " + o(e.value.format), 1)
137
- ]),
138
- _: 1
139
- })) : a("", !0),
140
- s(p)(e.value.exclusiveMinimum) ? (r(), i(n, { key: 6 }, {
141
- prefix: u(() => t[5] || (t[5] = [
142
- l("greater than: ")
143
- ])),
144
- default: u(() => [
145
- l(" " + o(e.value.exclusiveMinimum), 1)
146
- ]),
147
- _: 1
148
- })) : a("", !0),
149
- s(p)(e.value.minimum) ? (r(), i(n, { key: 7 }, {
150
- prefix: u(() => t[6] || (t[6] = [
151
- l("min: ")
152
- ])),
153
- default: u(() => [
154
- l(" " + o(e.value.minimum), 1)
155
- ]),
156
- _: 1
157
- })) : a("", !0),
158
- s(p)(e.value.exclusiveMaximum) ? (r(), i(n, { key: 8 }, {
159
- prefix: u(() => t[7] || (t[7] = [
160
- l("less than: ")
161
- ])),
162
- default: u(() => [
163
- l(" " + o(e.value.exclusiveMaximum), 1)
164
- ]),
165
- _: 1
166
- })) : a("", !0),
167
- s(p)(e.value.maximum) ? (r(), i(n, { key: 9 }, {
168
- prefix: u(() => t[8] || (t[8] = [
169
- l("max: ")
170
- ])),
171
- default: u(() => [
172
- l(" " + o(e.value.maximum), 1)
173
- ]),
174
- _: 1
175
- })) : a("", !0),
176
- s(p)(e.value.multipleOf) ? (r(), i(n, { key: 10 }, {
177
- prefix: u(() => t[9] || (t[9] = [
178
- l("multiple of: ")
179
- ])),
180
- default: u(() => [
181
- l(" " + o(e.value.multipleOf), 1)
182
- ]),
183
- _: 1
184
- })) : a("", !0),
185
- e.value.pattern ? (r(), i(n, {
186
- key: 11,
187
- code: "",
188
- truncate: ""
189
- }, {
190
- default: u(() => [
191
- y(S, null, {
192
- default: u(() => t[10] || (t[10] = [
193
- l("Pattern:")
151
+ __: [1]
152
+ })) : o.key === "pattern" ? (i(), m(S, { key: 1 }, {
153
+ default: n(() => t[2] || (t[2] = [
154
+ u(" Pattern: ")
194
155
  ])),
195
156
  _: 1,
196
- __: [10]
197
- }),
198
- l(" " + o(e.value.pattern), 1)
157
+ __: [2]
158
+ })) : l("", !0),
159
+ u(" " + v(o.value), 1)
199
160
  ]),
200
- _: 1
201
- })) : a("", !0),
202
- e.$props.enum ? (r(), i(n, { key: 12 }, {
203
- default: u(() => t[11] || (t[11] = [
204
- l("enum")
161
+ _: 2
162
+ }, [
163
+ o.prefix ? {
164
+ name: "prefix",
165
+ fn: n(() => [
166
+ u(v(o.prefix), 1)
167
+ ]),
168
+ key: "0"
169
+ } : void 0
170
+ ]), 1032, ["code", "truncate"]))), 128)),
171
+ r.enum ? (i(), m(p, { key: 1 }, {
172
+ default: n(() => t[3] || (t[3] = [
173
+ u("enum")
205
174
  ])),
206
175
  _: 1,
207
- __: [11]
208
- })) : a("", !0),
209
- e.value.default !== void 0 ? (r(), i(n, {
210
- key: 13,
176
+ __: [3]
177
+ })) : l("", !0),
178
+ N.value !== void 0 ? (i(), m(p, {
179
+ key: 2,
211
180
  truncate: ""
212
181
  }, {
213
- prefix: u(() => t[12] || (t[12] = [
214
- l("default: ")
182
+ prefix: n(() => t[4] || (t[4] = [
183
+ u("default:")
215
184
  ])),
216
- default: u(() => [
217
- l(" " + o(E(e.value)), 1)
185
+ default: n(() => [
186
+ u(v(N.value), 1)
218
187
  ]),
219
188
  _: 1
220
- })) : a("", !0)
221
- ], 64)) : a("", !0),
222
- e.additional ? (r(), m("div", G, [
223
- (N = e.value) != null && N["x-additionalPropertiesName"] ? (r(), m(f, { key: 0 }, [
224
- l(o(e.value["x-additionalPropertiesName"]), 1)
225
- ], 64)) : (r(), m(f, { key: 1 }, [
226
- l("additional properties")
189
+ })) : l("", !0)
190
+ ], 64)) : l("", !0),
191
+ r.additional ? (i(), a("div", Z, [
192
+ (s = r.value) != null && s["x-additionalPropertiesName"] ? (i(), a(c, { key: 0 }, [
193
+ u(v(r.value["x-additionalPropertiesName"]), 1)
194
+ ], 64)) : (i(), a(c, { key: 1 }, [
195
+ u("additional properties")
227
196
  ], 64))
228
- ])) : a("", !0),
229
- (M = e.value) != null && M.deprecated ? (r(), m("div", K, [
230
- y(s(H), null, {
231
- default: u(() => t[13] || (t[13] = [
232
- l("deprecated")
197
+ ])) : l("", !0),
198
+ (B = r.value) != null && B.deprecated ? (i(), a("div", ee, [
199
+ k(_(W), null, {
200
+ default: n(() => t[5] || (t[5] = [
201
+ u("deprecated")
233
202
  ])),
234
203
  _: 1,
235
- __: [13]
204
+ __: [5]
236
205
  })
237
- ])) : a("", !0),
238
- B.value !== void 0 ? (r(), m("div", Q, [
239
- y(n, { truncate: "" }, {
240
- prefix: u(() => t[14] || (t[14] = [
241
- l("const: ")
206
+ ])) : l("", !0),
207
+ h.value !== void 0 ? (i(), a("div", te, [
208
+ k(p, { truncate: "" }, {
209
+ prefix: n(() => t[6] || (t[6] = [
210
+ u("const: ")
242
211
  ])),
243
- default: u(() => [
244
- y(h, { value: B.value }, null, 8, ["value"])
212
+ default: n(() => [
213
+ k(Q, { value: h.value }, null, 8, ["value"])
245
214
  ]),
246
215
  _: 1
247
216
  })
248
- ])) : (r(), m(f, { key: 6 }, [
249
- ((q = e.value) == null ? void 0 : q.nullable) === !0 ? (r(), i(n, { key: 0 }, {
250
- default: u(() => t[15] || (t[15] = [
251
- l(" nullable ")
217
+ ])) : (i(), a(c, { key: 6 }, [
218
+ ((q = r.value) == null ? void 0 : q.nullable) === !0 ? (i(), m(p, { key: 0 }, {
219
+ default: n(() => t[7] || (t[7] = [
220
+ u(" nullable ")
252
221
  ])),
253
222
  _: 1,
254
- __: [15]
255
- })) : a("", !0)
223
+ __: [7]
224
+ })) : l("", !0)
256
225
  ], 64)),
257
- (w = e.value) != null && w.writeOnly ? (r(), m("div", U, " write-only ")) : (O = e.value) != null && O.readOnly ? (r(), m("div", W, " read-only ")) : a("", !0),
258
- e.required ? (r(), m("div", X, " required ")) : a("", !0),
259
- e.withExamples ? (r(), i(z, {
226
+ (w = r.value) != null && w.writeOnly ? (i(), a("div", re, " write-only ")) : (D = r.value) != null && D.readOnly ? (i(), a("div", ie, " read-only ")) : l("", !0),
227
+ r.required ? (i(), a("div", ae, " required ")) : l("", !0),
228
+ r.withExamples ? (i(), m(U, {
260
229
  key: 10,
261
- examples: (P = e.value) == null ? void 0 : P.examples,
262
- example: ((I = e.value) == null ? void 0 : I.example) || ((A = (V = e.value) == null ? void 0 : V.items) == null ? void 0 : A.example)
263
- }, null, 8, ["examples", "example"])) : a("", !0)
230
+ example: ((M = r.value) == null ? void 0 : M.example) || r.value && _(g)(r.value) && ((P = _(I)((O = r.value) == null ? void 0 : O.items)) == null ? void 0 : P.example),
231
+ examples: (A = r.value) == null ? void 0 : A.examples
232
+ }, null, 8, ["example", "examples"])) : l("", !0)
264
233
  ]);
265
234
  };
266
235
  }
267
236
  });
268
237
  export {
269
- ae as default
238
+ ve as default
270
239
  };
@@ -0,0 +1,11 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
3
+ /**
4
+ * Gets the "name" of the schema from the ref path
5
+ * TODO: this will change so fix it when the new refs are out
6
+ * Then add tests
7
+ *
8
+ * @example SchemaName from #/components/schemas/SchemaName
9
+ */
10
+ export declare const getRefName: (schema: ReferenceType<SchemaObject>) => string | null;
11
+ //# sourceMappingURL=get-ref-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ref-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,aAAa,CAAC,YAAY,CAAC,kBAa7D,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { REGEX as n } from "@scalar/helpers/regex/regex-helpers";
2
+ const o = (e) => {
3
+ const r = e.$ref;
4
+ if (!r)
5
+ return null;
6
+ const t = r.match(n.REF_NAME);
7
+ return t ? t[1] : null;
8
+ };
9
+ export {
10
+ o as getRefName
11
+ };
@@ -1,6 +1,16 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
2
3
  /**
3
4
  * Computes the human-readable type for a schema.
4
- **/
5
- export declare const getSchemaType: (value: OpenAPIV3_1.SchemaObject) => string;
5
+ *
6
+ * Priority order:
7
+ * 1. const values
8
+ * 2. Array types (with special handling for items)
9
+ * 3. title property
10
+ * 4. xml.name property
11
+ * 5. type with contentEncoding
12
+ * 6. $ref names
13
+ * 7. raw type
14
+ */
15
+ export declare const getSchemaType: (valueOrRef: SchemaObject | ReferenceType<SchemaObject>) => string;
6
16
  //# sourceMappingURL=get-schema-type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD;;IAEI;AACJ,eAAO,MAAM,aAAa,GAAI,OAAO,WAAW,CAAC,YAAY,KAAG,MAuD/D,CAAA"}
1
+ {"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAoC1F;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MA0DtF,CAAA"}
@@ -1,20 +1,41 @@
1
- const o = (t) => {
2
- var s;
3
- if ((t == null ? void 0 : t.const) !== void 0)
1
+ import { getResolvedRef as y } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
+ import { isArraySchema as s } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
3
+ import { getRefName as p } from "./get-ref-name.js";
4
+ const c = (t) => t ? `array ${t.includes(" | ") ? `(${t})` : t}[]` : "array", o = (t, r = !1) => {
5
+ var n;
6
+ if (!t.items)
7
+ return r ? "array" : t.title || ((n = t.xml) == null ? void 0 : n.name) || "array";
8
+ const i = f(t.items), e = c(i);
9
+ return r ? e : t.nullable ? `${e} | null` : e;
10
+ }, f = (t) => {
11
+ var i;
12
+ if (!t)
13
+ return "";
14
+ const r = y(t);
15
+ if (r.const !== void 0)
4
16
  return "const";
5
- if (Array.isArray(t == null ? void 0 : t.type)) {
6
- if (t.type.includes("array") && t.items) {
7
- const r = o(t.items), i = r != null && r.includes(" | ") ? `(${r})` : r, n = r ? `array ${i}[]` : "array", y = t.type.filter((c) => c !== "array");
8
- return y.length > 0 ? `${n} | ${y.join(" | ")}` : n;
17
+ if ("type" in r && Array.isArray(r.type)) {
18
+ if (r.type.includes("array") && r.items) {
19
+ const e = o(r, !0), n = r.type.filter((a) => a !== "array");
20
+ return n.length > 0 ? `${e} | ${n.join(" | ")}` : e;
9
21
  }
10
- return t.type.join(" | ");
22
+ return r.type.join(" | ");
11
23
  }
12
- if ((t == null ? void 0 : t.type) === "array" && t.items) {
13
- const r = o(t.items), i = r != null && r.includes(" | ") ? `(${r})` : r, n = r ? `array ${i}[]` : "array";
14
- return t.nullable ? `${n} | null` : n;
24
+ if (s(r))
25
+ return o(r, !1);
26
+ if (r.title)
27
+ return r.title;
28
+ if ((i = r.xml) != null && i.name)
29
+ return r.xml.name;
30
+ if ("type" in r && r.type && r.contentEncoding)
31
+ return `${r.type} • ${r.contentEncoding}`;
32
+ if ("$ref" in t) {
33
+ const e = p(t);
34
+ if (e)
35
+ return e;
15
36
  }
16
- return t != null && t.title ? t.title : t != null && t.name ? t.name : (s = t == null ? void 0 : t.xml) != null && s.name ? t.xml.name : t != null && t.type && t.contentEncoding ? `${t.type} • ${t.contentEncoding}` : (t == null ? void 0 : t.type) ?? "";
37
+ return "type" in r ? r.type : "";
17
38
  };
18
39
  export {
19
- o as getSchemaType
40
+ f as getSchemaType
20
41
  };
@@ -1,3 +1,5 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
- export declare const isTypeObject: (schema: unknown) => schema is OpenAPIV3_1.SchemaObject;
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ export declare const isTypeObject: (schema: unknown) => schema is Extract<SchemaObject, {
3
+ type: "object";
4
+ }>;
3
5
  //# sourceMappingURL=is-type-object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-type-object.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/is-type-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAKxD,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,WAAW,CAAC,YAsCpE,CAAA"}
1
+ {"version":3,"file":"is-type-object.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/is-type-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAsChG,CAAA"}
@@ -1,5 +1,4 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
- type SchemaObject = OpenAPIV3_1.SchemaObject;
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
2
  /**
4
3
  * Merges multiple OpenAPI schema objects into a single schema object.
5
4
  * Handles nested allOf compositions and merges properties recursively.
@@ -8,6 +7,5 @@ type SchemaObject = OpenAPIV3_1.SchemaObject;
8
7
  * @param rootSchema - Optional root schema to merge with the result
9
8
  * @returns Merged schema object
10
9
  */
11
- export declare function mergeAllOfSchemas(schemas: SchemaObject[], rootSchema?: SchemaObject, depth?: number): SchemaObject;
12
- export {};
10
+ export declare const mergeAllOfSchemas: (schemas: SchemaObject | undefined, rootSchema?: SchemaObject) => SchemaObject;
13
11
  //# sourceMappingURL=merge-all-of-schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"merge-all-of-schemas.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,KAAK,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;AAQ5C;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,KAAK,SAAI,GAAG,YAAY,CAmD7G"}
1
+ {"version":3,"file":"merge-all-of-schemas.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,YAAY,GAAG,SAAS,EAAE,aAAa,YAAY,KAAG,YA+ChG,CAAA"}