@scalar/api-reference 1.35.3 → 1.35.4

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 (27) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/browser/standalone.js +2161 -2145
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Content/Schema/Schema.vue.d.ts +4 -0
  5. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  6. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  7. package/dist/components/Content/Schema/Schema.vue2.js +71 -65
  8. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +4 -0
  9. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  10. package/dist/components/Content/Schema/SchemaComposition.vue.js +44 -38
  11. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +4 -0
  12. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +49 -41
  14. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -0
  15. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  17. package/dist/components/Content/Schema/SchemaProperty.vue2.js +96 -88
  18. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  19. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  20. package/dist/features/Operation/components/ParameterListItem.vue2.js +20 -19
  21. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  22. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  23. package/dist/features/Operation/components/RequestBody.vue2.js +28 -25
  24. package/dist/features/api-client-modal/useApiClient.d.ts +90 -90
  25. package/dist/index.js +1 -1
  26. package/dist/style.css +1 -1
  27. package/package.json +11 -11
@@ -10,6 +10,10 @@ type __VLS_Props = {
10
10
  noncollapsible?: boolean;
11
11
  /** Hide the heading */
12
12
  hideHeading?: boolean;
13
+ /** Hide read-only properties */
14
+ hideReadOnly?: boolean;
15
+ /** Hide write-only properties */
16
+ hideWriteOnly?: boolean;
13
17
  /** Show a special one way toggle for additional properties, also has a top border when open */
14
18
  additionalProperties?: boolean;
15
19
  /** Hide model names in type display */
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AA0UA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAUrE,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,uBAAuB;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;AAoaF,wBAMG"}
1
+ {"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AAoVA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAUrE,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,uBAAuB;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;AA8aF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Schema.vue2.js";
2
2
  import "./Schema.vue3.js";
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-35a08997"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6897f9dc"]]);
5
5
  export {
6
- p as default
6
+ c as default
7
7
  };
@@ -1,18 +1,18 @@
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";
1
+ import { defineComponent as R, computed as B, createBlock as d, createCommentVNode as n, openBlock as l, unref as i, withCtx as s, createElementVNode as S, normalizeClass as m, createElementBlock as r, createVNode as o, withDirectives as C, createTextVNode as h, toDisplayString as y, vShow as N, normalizeStyle as M, Fragment as u } from "vue";
2
+ import { Disclosure as w, DisclosureButton as H, DisclosurePanel as W } from "@headlessui/vue";
3
+ import { ScalarMarkdown as D, ScalarIcon as p } from "@scalar/components";
4
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 = {
5
+ import { isTypeObject as z } from "./helpers/is-type-object.js";
6
+ import A from "./SchemaHeading.vue.js";
7
+ import V from "./SchemaObjectProperties.vue.js";
8
+ import j from "./SchemaProperty.vue.js";
9
+ const T = {
10
10
  key: 0,
11
11
  class: "schema-card-description"
12
- }, R = {
12
+ }, $ = {
13
13
  key: 0,
14
14
  class: "schema-properties"
15
- }, U = /* @__PURE__ */ M({
15
+ }, Q = /* @__PURE__ */ R({
16
16
  __name: "Schema",
17
17
  props: {
18
18
  schema: {},
@@ -21,98 +21,100 @@ const E = {
21
21
  compact: { type: Boolean },
22
22
  noncollapsible: { type: Boolean, default: !1 },
23
23
  hideHeading: { type: Boolean },
24
+ hideReadOnly: { type: Boolean },
25
+ hideWriteOnly: { type: Boolean },
24
26
  additionalProperties: { type: Boolean },
25
27
  hideModelNames: { type: Boolean, default: !1 },
26
28
  discriminator: {},
27
29
  breadcrumb: {}
28
30
  },
29
31
  setup(a) {
30
- const v = C(() => !a.noncollapsible && a.level > 0), y = C(() => {
31
- var e, n;
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;
32
+ const f = B(() => !a.noncollapsible && a.level > 0), v = B(() => {
33
+ var e, c;
34
+ return (e = a.schema) != null && e.allOf && a.schema.allOf.length > 0 && a.name === "Request Body" ? a.schema.description || a.schema.allOf[0].description : !((c = a.schema) != null && c.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
35
  }), b = (e) => a.noncollapsible && e.stopPropagation();
34
- return (e, n) => typeof e.schema == "object" && Object.keys(e.schema).length ? (l(), s(i(D), {
36
+ return (e, c) => typeof e.schema == "object" && Object.keys(e.schema).length ? (l(), d(i(w), {
35
37
  key: 0,
36
38
  defaultOpen: e.noncollapsible
37
39
  }, {
38
- default: r(({ open: t }) => [
39
- N("div", {
40
- class: d(["schema-card", [
40
+ default: s(({ open: t }) => [
41
+ S("div", {
42
+ class: m(["schema-card", [
41
43
  `schema-card--level-${e.level}`,
42
44
  { "schema-card--compact": e.compact, "schema-card--open": t },
43
45
  { "border-t": e.additionalProperties && t }
44
46
  ]])
45
47
  }, [
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", {
48
+ v.value ? (l(), r("div", T, [
49
+ o(i(D), { value: v.value }, null, 8, ["value"])
50
+ ])) : n("", !0),
51
+ S("div", {
52
+ class: m(["schema-properties", {
51
53
  "schema-properties-open": t
52
54
  }])
53
55
  }, [
54
- e.additionalProperties ? B((l(), o("div", R, [
55
- m(i(O), {
56
+ e.additionalProperties ? C((l(), r("div", $, [
57
+ o(i(H), {
56
58
  as: "button",
57
59
  class: "schema-card-title schema-card-title--compact",
58
60
  onClickCapture: b
59
61
  }, {
60
- default: r(() => [
61
- m(i(p), {
62
+ default: s(() => [
63
+ o(i(p), {
62
64
  class: "schema-card-title-icon",
63
65
  icon: "Add",
64
66
  size: "sm"
65
67
  }),
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)
68
+ c[0] || (c[0] = h(" Show additional properties ")),
69
+ e.name ? (l(), d(P, { key: 0 }, {
70
+ default: s(() => [
71
+ h("for " + y(e.name), 1)
70
72
  ]),
71
73
  _: 1
72
- })) : c("", !0)
74
+ })) : n("", !0)
73
75
  ]),
74
76
  _: 1,
75
77
  __: [0]
76
78
  })
77
79
  ], 512)), [
78
- [H, !t]
79
- ]) : v.value ? B((l(), s(i(O), {
80
+ [N, !t]
81
+ ]) : f.value ? C((l(), d(i(H), {
80
82
  key: 1,
81
83
  as: e.noncollapsible ? "div" : "button",
82
- class: d(["schema-card-title", { "schema-card-title--compact": e.compact }]),
83
- style: w({
84
+ class: m(["schema-card-title", { "schema-card-title--compact": e.compact }]),
85
+ style: M({
84
86
  top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
85
87
  }),
86
88
  onClickCapture: b
87
89
  }, {
88
- default: r(() => {
89
- var k, g, S;
90
+ default: s(() => {
91
+ var O, k, g;
90
92
  return [
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 }]),
93
+ e.compact ? (l(), r(u, { key: 0 }, [
94
+ o(i(p), {
95
+ class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
94
96
  icon: "Add",
95
97
  size: "sm"
96
98
  }, null, 8, ["class"]),
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)
99
+ t ? (l(), r(u, { key: 0 }, [
100
+ h(" Hide " + y(((O = e.schema) == null ? void 0 : O.title) ?? "Child Attributes"), 1)
101
+ ], 64)) : (l(), r(u, { key: 1 }, [
102
+ h(" Show " + y(((k = e.schema) == null ? void 0 : k.title) ?? "Child Attributes"), 1)
101
103
  ], 64)),
102
- e.name ? (l(), s(P, { key: 2 }, {
103
- default: r(() => [
104
- h("for " + f(e.name), 1)
104
+ e.name ? (l(), d(P, { key: 2 }, {
105
+ default: s(() => [
106
+ h("for " + y(e.name), 1)
105
107
  ]),
106
108
  _: 1
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 }]),
109
+ })) : n("", !0)
110
+ ], 64)) : (l(), r(u, { key: 1 }, [
111
+ o(i(p), {
112
+ class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
111
113
  icon: "Add",
112
114
  size: "sm"
113
115
  }, null, 8, ["class"]),
114
- m(j, {
115
- name: ((S = e.schema) == null ? void 0 : S.title) ?? e.name,
116
+ o(A, {
117
+ name: ((g = e.schema) == null ? void 0 : g.title) ?? e.name,
116
118
  value: e.schema
117
119
  }, null, 8, ["name", "value"])
118
120
  ], 64))
@@ -120,44 +122,48 @@ const E = {
120
122
  }),
121
123
  _: 2
122
124
  }, 1032, ["as", "class", "style"])), [
123
- [H, !e.hideHeading && !(e.noncollapsible && e.compact)]
124
- ]) : c("", !0),
125
- !e.additionalProperties || t ? (l(), s(i(z), {
125
+ [N, !e.hideHeading && !(e.noncollapsible && e.compact)]
126
+ ]) : n("", !0),
127
+ !e.additionalProperties || t ? (l(), d(i(W), {
126
128
  key: 2,
127
129
  as: "ul",
128
- static: !v.value
130
+ static: !f.value
129
131
  }, {
130
- default: r(() => [
131
- i(V)(e.schema) ? (l(), s(T, {
132
+ default: s(() => [
133
+ i(z)(e.schema) ? (l(), d(V, {
132
134
  key: 0,
133
135
  breadcrumb: e.breadcrumb,
134
136
  compact: e.compact,
135
137
  discriminator: e.discriminator,
136
138
  hideHeading: e.hideHeading,
137
139
  hideModelNames: e.hideModelNames,
140
+ hideReadOnly: e.hideReadOnly,
141
+ hideWriteOnly: e.hideWriteOnly,
138
142
  level: e.level + 1,
139
143
  schema: e.schema
140
- }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "schema"])) : (l(), o(u, { key: 1 }, [
141
- e.schema ? (l(), s($, {
144
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "schema"])) : (l(), r(u, { key: 1 }, [
145
+ e.schema ? (l(), d(j, {
142
146
  key: 0,
143
147
  breadcrumb: e.breadcrumb,
144
148
  compact: e.compact,
145
149
  hideHeading: e.hideHeading,
146
150
  hideModelNames: e.hideModelNames,
151
+ hideReadOnly: e.hideReadOnly,
152
+ hideWriteOnly: e.hideWriteOnly,
147
153
  level: e.level,
148
154
  value: e.schema
149
- }, null, 8, ["breadcrumb", "compact", "hideHeading", "hideModelNames", "level", "value"])) : c("", !0)
155
+ }, null, 8, ["breadcrumb", "compact", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "value"])) : n("", !0)
150
156
  ], 64))
151
157
  ]),
152
158
  _: 1
153
- }, 8, ["static"])) : c("", !0)
159
+ }, 8, ["static"])) : n("", !0)
154
160
  ], 2)
155
161
  ], 2)
156
162
  ]),
157
163
  _: 1
158
- }, 8, ["defaultOpen"])) : c("", !0);
164
+ }, 8, ["defaultOpen"])) : n("", !0);
159
165
  }
160
166
  });
161
167
  export {
162
- U as default
168
+ Q as default
163
169
  };
@@ -15,6 +15,10 @@ type __VLS_Props = {
15
15
  compact?: boolean;
16
16
  /** Whether to hide the heading */
17
17
  hideHeading?: boolean;
18
+ /** Whether to hide read-only properties */
19
+ hideReadOnly?: boolean;
20
+ /** Hide write-only properties */
21
+ hideWriteOnly?: boolean;
18
22
  /** Breadcrumb for navigation */
19
23
  breadcrumb?: string[];
20
24
  };
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAwJA,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,2CAA2C;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;aATU,OAAO;iBAEH,OAAO;;AA+NzB,wBAOG"}
@@ -1,18 +1,18 @@
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 = {
1
+ import { defineComponent as O, computed as d, ref as C, createElementBlock as m, openBlock as t, createBlock as S, unref as s, Fragment as R, createVNode as c, createElementVNode as r, withCtx as B, createCommentVNode as H, toDisplayString as v, normalizeClass as W } from "vue";
2
+ import { ScalarListbox as k } from "@scalar/components";
3
+ import { isDefined as V } from "@scalar/helpers/array/is-defined";
4
+ import { ScalarIconCaretDown as w } from "@scalar/icons";
5
+ import { getResolvedRef as N } from "@scalar/workspace-store/helpers/get-resolved-ref";
6
+ import { getSchemaType as z } from "./helpers/get-schema-type.js";
7
+ import { mergeAllOfSchemas as D } from "./helpers/merge-all-of-schemas.js";
8
+ import f from "./Schema.vue.js";
9
+ const U = { class: "property-rule" }, A = {
10
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",
11
11
  type: "button"
12
- }, L = { class: "text-c-2" }, R = {
12
+ }, E = { class: "text-c-2" }, L = {
13
13
  key: 0,
14
14
  class: "text-red"
15
- }, T = { class: "composition-panel" }, K = /* @__PURE__ */ C({
15
+ }, T = { class: "composition-panel" }, K = /* @__PURE__ */ O({
16
16
  __name: "SchemaComposition",
17
17
  props: {
18
18
  composition: {},
@@ -22,65 +22,71 @@ const A = { class: "property-rule" }, E = {
22
22
  level: {},
23
23
  compact: { type: Boolean, default: !1 },
24
24
  hideHeading: { type: Boolean, default: !1 },
25
+ hideReadOnly: { type: Boolean },
26
+ hideWriteOnly: { type: Boolean },
25
27
  breadcrumb: {}
26
28
  },
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) => ({
29
+ setup(y) {
30
+ const a = y, p = d(
31
+ () => [a.value[a.composition]].flat().map((e) => ({ value: N(e), original: e })).filter((e) => V(e.value))
32
+ ), u = d(
33
+ () => p.value.map((e, o) => ({
32
34
  id: String(o),
33
- label: U(e.original) || "Schema"
35
+ label: z(e.original) || "Schema"
34
36
  }))
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
+ ), i = C(u.value[0]), g = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (o) => o.toUpperCase()).toLowerCase().replace(/^(\w)/, (o) => o.toUpperCase()), n = d(
38
+ () => p.value[Number(i.value.id)].value
37
39
  );
38
- return (e, o) => (r(), s("div", A, [
39
- a.composition === "allOf" ? (r(), H(h, {
40
+ return (e, o) => (t(), m("div", U, [
41
+ a.composition === "allOf" ? (t(), S(f, {
40
42
  key: 0,
41
43
  breadcrumb: e.breadcrumb,
42
44
  compact: e.compact,
43
45
  discriminator: e.discriminator,
44
46
  hideHeading: e.hideHeading,
47
+ hideReadOnly: e.hideReadOnly,
48
+ hideWriteOnly: e.hideWriteOnly,
45
49
  level: e.level,
46
50
  name: e.name,
47
51
  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),
52
+ schema: s(D)(a.value)
53
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideReadOnly", "hideWriteOnly", "level", "name", "schema"])) : (t(), m(R, { key: 1 }, [
54
+ c(s(k), {
55
+ modelValue: i.value,
56
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => i.value = l),
53
57
  options: u.value,
54
58
  resize: ""
55
59
  }, {
56
- default: V(() => {
57
- var l, b, v;
60
+ default: B(() => {
61
+ var l, h, b;
58
62
  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
+ r("button", A, [
64
+ r("span", E, v(g(a.composition)), 1),
65
+ r("span", {
66
+ class: W(["composition-selector-label text-c-1", {
63
67
  "line-through": (l = n.value) == null ? void 0 : l.deprecated
64
68
  }])
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))
69
+ }, v(((h = i.value) == null ? void 0 : h.label) || "Schema"), 3),
70
+ (b = n.value) != null && b.deprecated ? (t(), m("div", L, " deprecated ")) : H("", !0),
71
+ c(s(w))
68
72
  ])
69
73
  ];
70
74
  }),
71
75
  _: 1
72
76
  }, 8, ["modelValue", "options"]),
73
- i("div", T, [
74
- p(h, {
77
+ r("div", T, [
78
+ c(f, {
75
79
  breadcrumb: e.breadcrumb,
76
80
  compact: e.compact,
77
81
  discriminator: e.discriminator,
78
82
  hideHeading: e.hideHeading,
83
+ hideReadOnly: e.hideReadOnly,
84
+ hideWriteOnly: e.hideWriteOnly,
79
85
  level: e.level + 1,
80
86
  name: e.name,
81
87
  noncollapsible: !0,
82
88
  schema: n.value
83
- }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "level", "name", "schema"])
89
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideReadOnly", "hideWriteOnly", "level", "name", "schema"])
84
90
  ])
85
91
  ], 64))
86
92
  ]));
@@ -7,6 +7,10 @@ type __VLS_Props = {
7
7
  hideHeading?: boolean;
8
8
  level?: number;
9
9
  hideModelNames?: boolean;
10
+ /** Hide readonly properties */
11
+ hideReadOnly?: boolean;
12
+ /** Hide write-only properties */
13
+ hideWriteOnly?: boolean;
10
14
  breadcrumb?: string[];
11
15
  orderSchemaPropertiesBy?: ApiReferenceConfiguration['orderSchemaPropertiesBy'];
12
16
  orderRequiredPropertiesFirst?: ApiReferenceConfiguration['orderRequiredPropertiesFirst'];
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAoLA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAOrE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,uBAAuB,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;IAC9E,4BAA4B,CAAC,EAAE,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;CACzF,CAAC;;AAkOF,wBAMG"}
1
+ {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAiNA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAOrE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,uBAAuB,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;IAC9E,4BAA4B,CAAC,EAAE,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;CACzF,CAAC;;AAiQF,wBAMG"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as j, computed as q, createElementBlock as d, openBlock as o, Fragment as s, createCommentVNode as l, createBlock as c, unref as m, renderList as g } from "vue";
2
- import { getResolvedRef as u } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { isTypeObject as n } from "./helpers/is-type-object.js";
4
- import h from "./SchemaProperty.vue.js";
5
- const O = /* @__PURE__ */ j({
1
+ import { defineComponent as W, computed as B, createElementBlock as l, openBlock as d, Fragment as s, createCommentVNode as h, createBlock as c, unref as n, renderList as N } from "vue";
2
+ import { getResolvedRef as o } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
+ import { isTypeObject as m } from "./helpers/is-type-object.js";
4
+ import u from "./SchemaProperty.vue.js";
5
+ const k = /* @__PURE__ */ W({
6
6
  __name: "SchemaObjectProperties",
7
7
  props: {
8
8
  schema: {},
@@ -11,81 +11,89 @@ const O = /* @__PURE__ */ j({
11
11
  hideHeading: { type: Boolean },
12
12
  level: {},
13
13
  hideModelNames: { type: Boolean },
14
+ hideReadOnly: { type: Boolean },
15
+ hideWriteOnly: { type: Boolean },
14
16
  breadcrumb: {},
15
17
  orderSchemaPropertiesBy: { default: "alpha" },
16
18
  orderRequiredPropertiesFirst: { default: !0 }
17
19
  },
18
- setup(i) {
19
- const P = q(() => {
20
- if (!n(i.schema) || !i.schema.properties)
20
+ setup(r) {
21
+ const g = B(() => {
22
+ if (!m(r.schema) || !r.schema.properties)
21
23
  return [];
22
- const e = Object.keys(i.schema.properties), a = new Set(i.schema.required || []);
23
- return e.sort((r, t) => {
24
- var v, N;
25
- const p = r === ((v = i.discriminator) == null ? void 0 : v.propertyName), b = t === ((N = i.discriminator) == null ? void 0 : N.propertyName), f = a.has(r), y = a.has(t);
26
- if (p && !b)
24
+ const e = Object.keys(r.schema.properties), a = new Set(r.schema.required || []);
25
+ return e.sort((i, t) => {
26
+ var f, v;
27
+ const y = i === ((f = r.discriminator) == null ? void 0 : f.propertyName), p = t === ((v = r.discriminator) == null ? void 0 : v.propertyName), b = a.has(i), O = a.has(t);
28
+ if (y && !p)
27
29
  return -1;
28
- if (!p && b)
30
+ if (!y && p)
29
31
  return 1;
30
- if (i.orderRequiredPropertiesFirst) {
31
- if (f && !y)
32
+ if (r.orderRequiredPropertiesFirst) {
33
+ if (b && !O)
32
34
  return -1;
33
- if (!f && y)
35
+ if (!b && O)
34
36
  return 1;
35
37
  }
36
- return i.orderSchemaPropertiesBy === "alpha" ? r.localeCompare(t) : 0;
37
- });
38
- }), H = (e) => {
39
- const a = u(e);
38
+ return r.orderSchemaPropertiesBy === "alpha" ? i.localeCompare(t) : 0;
39
+ }).filter((i) => r.hideReadOnly ? !(r.schema.properties && o(r.schema.properties[i]).readOnly === !0) : r.hideWriteOnly ? !(r.schema.properties && o(r.schema.properties[i]).writeOnly === !0) : !0);
40
+ }), R = (e) => {
41
+ const a = o(e);
40
42
  return typeof a == "object" && typeof a["x-additionalPropertiesName"] == "string" && a["x-additionalPropertiesName"].trim().length > 0 ? `${a["x-additionalPropertiesName"].trim()}*` : "propertyName*";
41
- }, M = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
43
+ }, P = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
42
44
  // @ts-expect-error - ask hans
43
45
  type: "anything",
44
46
  ...typeof e == "object" ? e : {}
45
47
  } : e;
46
- return (e, a) => (o(), d(s, null, [
47
- m(n)(e.schema) && e.schema.properties ? (o(!0), d(s, { key: 0 }, g(P.value, (r) => {
48
+ return (e, a) => (d(), l(s, null, [
49
+ n(m)(e.schema) && e.schema.properties ? (d(!0), l(s, { key: 0 }, N(g.value, (i) => {
48
50
  var t;
49
- return o(), c(h, {
50
- key: r,
51
+ return d(), c(u, {
52
+ key: i,
51
53
  breadcrumb: e.breadcrumb,
52
54
  compact: e.compact,
53
55
  discriminator: e.discriminator,
54
56
  hideHeading: e.hideHeading,
55
57
  hideModelNames: e.hideModelNames,
58
+ hideReadOnly: e.hideReadOnly,
59
+ hideWriteOnly: e.hideWriteOnly,
56
60
  level: e.level,
57
- name: r,
58
- required: (t = e.schema.required) == null ? void 0 : t.includes(r),
59
- value: m(u)(e.schema.properties[r])
60
- }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "required", "value"]);
61
- }), 128)) : l("", !0),
62
- m(n)(e.schema) && e.schema.patternProperties ? (o(!0), d(s, { key: 1 }, g(Object.entries(e.schema.patternProperties), ([r, t]) => (o(), c(h, {
63
- key: r,
61
+ name: i,
62
+ required: (t = e.schema.required) == null ? void 0 : t.includes(i),
63
+ value: n(o)(e.schema.properties[i])
64
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "required", "value"]);
65
+ }), 128)) : h("", !0),
66
+ n(m)(e.schema) && e.schema.patternProperties ? (d(!0), l(s, { key: 1 }, N(Object.entries(e.schema.patternProperties), ([i, t]) => (d(), c(u, {
67
+ key: i,
64
68
  breadcrumb: e.breadcrumb,
65
69
  compact: e.compact,
66
70
  discriminator: e.discriminator,
67
71
  hideHeading: e.hideHeading,
68
72
  hideModelNames: e.hideModelNames,
73
+ hideReadOnly: e.hideReadOnly,
74
+ hideWriteOnly: e.hideWriteOnly,
69
75
  level: e.level,
70
- name: r,
71
- value: m(u)(t)
72
- }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "value"]))), 128)) : l("", !0),
73
- m(n)(e.schema) && e.schema.additionalProperties ? (o(), c(h, {
76
+ name: i,
77
+ value: n(o)(t)
78
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "value"]))), 128)) : h("", !0),
79
+ n(m)(e.schema) && e.schema.additionalProperties ? (d(), c(u, {
74
80
  key: 2,
75
81
  breadcrumb: e.breadcrumb,
76
82
  compact: e.compact,
77
83
  discriminator: e.discriminator,
78
84
  hideHeading: e.hideHeading,
79
85
  hideModelNames: e.hideModelNames,
86
+ hideReadOnly: e.hideReadOnly,
87
+ hideWriteOnly: e.hideWriteOnly,
80
88
  level: e.level,
81
- name: H(e.schema.additionalProperties),
89
+ name: R(e.schema.additionalProperties),
82
90
  noncollapsible: "",
83
- value: M(e.schema.additionalProperties),
91
+ value: P(e.schema.additionalProperties),
84
92
  variant: "additionalProperties"
85
- }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "level", "name", "value"])) : l("", !0)
93
+ }, null, 8, ["breadcrumb", "compact", "discriminator", "hideHeading", "hideModelNames", "hideReadOnly", "hideWriteOnly", "level", "name", "value"])) : h("", !0)
86
94
  ], 64));
87
95
  }
88
96
  });
89
97
  export {
90
- O as default
98
+ k as default
91
99
  };
@@ -18,6 +18,10 @@ type __VLS_Props = {
18
18
  description?: string;
19
19
  hideModelNames?: boolean;
20
20
  hideHeading?: boolean;
21
+ /** Hide read-only properties */
22
+ hideReadOnly?: boolean;
23
+ /** Hide write-only properties */
24
+ hideWriteOnly?: boolean;
21
25
  variant?: 'additionalProperties' | 'patternProperties';
22
26
  breadcrumb?: string[];
23
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAuiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAErE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAa9C;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;cARW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;;AA+iB5B,0BAOG"}
1
+ {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAijBA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAErE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAa9C;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;;AA+jB5B,0BAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaProperty.vue2.js";
2
2
  import "./SchemaProperty.vue3.js";
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-88b924d1"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7569fa08"]]);
5
5
  export {
6
- a as default
6
+ p as default
7
7
  };