@scalar/api-reference 1.29.2 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +13 -114
  3. package/dist/browser/standalone.js +2402 -2306
  4. package/dist/browser/webpack-stats.json +1 -1
  5. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  6. package/dist/components/Content/Introduction/Introduction.vue2.js +1 -1
  7. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  9. package/dist/components/Content/Schema/Schema.vue2.js +118 -84
  10. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Schema/SchemaComposition.vue.js +62 -60
  12. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +13 -0
  13. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
  14. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +49 -0
  15. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +4 -0
  16. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  18. package/dist/components/Content/Schema/SchemaProperty.vue2.js +40 -39
  19. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  20. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  21. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +133 -114
  22. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +9 -1
  23. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +1 -1
  24. package/dist/components/Content/Schema/helpers/schema-discriminator.js +45 -0
  25. package/dist/components/Section/SectionHeaderTag.vue.d.ts.map +1 -1
  26. package/dist/components/Section/SectionHeaderTag.vue.js +2 -2
  27. package/dist/features/ApiClientModal/useApiClient.d.ts +28 -8
  28. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  29. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +14 -0
  30. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -0
  31. package/dist/features/Operation/components/callbacks/Callback.vue.js +7 -0
  32. package/dist/features/Operation/components/callbacks/Callback.vue2.js +62 -0
  33. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +10 -0
  34. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -0
  35. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +30 -0
  36. package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +4 -0
  37. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -2
  38. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  39. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  40. package/dist/features/Operation/layouts/ModernLayout.vue2.js +86 -74
  41. package/dist/features/Operation/types/schemas.d.ts +3 -0
  42. package/dist/features/Operation/types/schemas.d.ts.map +1 -0
  43. package/dist/index.js +1 -1
  44. package/dist/style.css +1 -1
  45. package/package.json +8 -8
@@ -1,33 +1,36 @@
1
- import { defineComponent as z, computed as D, createElementBlock as m, openBlock as l, createCommentVNode as i, createBlock as d, normalizeClass as H, renderSlot as E, Fragment as y, createTextVNode as u, withCtx as a, createVNode as v, toDisplayString as n, unref as g } from "vue";
1
+ import { defineComponent as H, computed as b, createElementBlock as n, openBlock as r, createCommentVNode as i, createBlock as d, normalizeClass as J, renderSlot as E, Fragment as y, createTextVNode as l, withCtx as a, createVNode as v, toDisplayString as m, unref as N } from "vue";
2
2
  import { isDefined as B } from "@scalar/oas-utils/helpers";
3
- import { stringify as L } from "flatted";
4
- import { compositions as J } from "./helpers/schema-composition.js";
5
- import R from "./SchemaPropertyExamples.vue.js";
6
- import b from "../../ScreenReader.vue.js";
7
- import o from "./SchemaPropertyDetail.vue.js";
8
- import O from "../../Badge/Badge.vue.js";
3
+ import { stringify as g } from "flatted";
4
+ import { compositions as R } from "./helpers/schema-composition.js";
5
+ import W from "./SchemaPropertyExamples.vue.js";
6
+ import j from "../../ScreenReader.vue.js";
7
+ import s from "./SchemaPropertyDetail.vue.js";
8
+ import L from "../../Badge/Badge.vue.js";
9
9
  const G = { class: "property-heading" }, K = {
10
- key: 2,
11
- class: "property-additional"
10
+ key: 1,
11
+ class: "property-discriminator"
12
12
  }, Q = {
13
13
  key: 3,
14
- class: "property-pattern"
14
+ class: "property-additional"
15
15
  }, U = {
16
16
  key: 4,
17
- class: "property-deprecated"
18
- }, W = {
19
- key: 5,
20
- class: "property-const"
17
+ class: "property-pattern"
21
18
  }, X = {
22
- key: 7,
23
- class: "property-write-only"
19
+ key: 5,
20
+ class: "property-deprecated"
24
21
  }, Y = {
25
- key: 8,
26
- class: "property-read-only"
22
+ key: 6,
23
+ class: "property-const"
27
24
  }, Z = {
25
+ key: 8,
26
+ class: "property-write-only"
27
+ }, h = {
28
28
  key: 9,
29
+ class: "property-read-only"
30
+ }, x = {
31
+ key: 10,
29
32
  class: "property-required"
30
- }, ae = /* @__PURE__ */ z({
33
+ }, ie = /* @__PURE__ */ H({
31
34
  __name: "SchemaPropertyHeading",
32
35
  props: {
33
36
  value: {},
@@ -38,236 +41,252 @@ const G = { class: "property-heading" }, K = {
38
41
  withExamples: { type: Boolean, default: !0 },
39
42
  schemas: {}
40
43
  },
41
- setup(r) {
42
- J.find((e) => !r.value || typeof r.value != "object" ? !1 : e in r.value || r.value.items && typeof r.value.items == "object" && e in r.value.items);
43
- const $ = (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" ? JSON.stringify(e.default) : e == null ? void 0 : e.default, F = (e) => {
44
+ setup(u) {
45
+ R.find((e) => !u.value || typeof u.value != "object" ? !1 : e in u.value || u.value.items && typeof u.value.items == "object" && e in u.value.items);
46
+ const T = (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" ? JSON.stringify(e.default) : e == null ? void 0 : e.default, M = (e) => {
44
47
  if (!e)
45
48
  return null;
46
49
  if (e.title)
47
50
  return e.title;
48
51
  if (e.name)
49
52
  return e.name;
50
- if (r.schemas && typeof r.schemas == "object") {
51
- for (const [t, s] of Object.entries(r.schemas))
52
- if (L(s) === L(e))
53
+ if (u.schemas && typeof u.schemas == "object") {
54
+ for (const [t, o] of Object.entries(u.schemas))
55
+ if (g(o) === g(e))
53
56
  return t;
57
+ if (e.type === "object" && e.properties) {
58
+ for (const [t, o] of Object.entries(u.schemas))
59
+ if (g(o.properties) === g(e.properties))
60
+ return t;
61
+ }
54
62
  }
55
63
  return null;
56
- }, N = D(() => {
57
- var e, t, s, f, p, k;
58
- if (B((e = r.value) == null ? void 0 : e.const))
59
- return (t = r.value) == null ? void 0 : t.const;
60
- if (((f = (s = r.value) == null ? void 0 : s.enum) == null ? void 0 : f.length) === 1)
61
- return r.value.enum[0];
62
- if ((p = r.value) != null && p.items) {
63
- if (B(r.value.items.const))
64
- return r.value.items.const;
65
- if (((k = r.value.items.enum) == null ? void 0 : k.length) === 1)
66
- return r.value.items.enum[0];
64
+ }, S = b(() => {
65
+ var e, t, o, f, p, k;
66
+ if (B((e = u.value) == null ? void 0 : e.const))
67
+ return (t = u.value) == null ? void 0 : t.const;
68
+ if (((f = (o = u.value) == null ? void 0 : o.enum) == null ? void 0 : f.length) === 1)
69
+ return u.value.enum[0];
70
+ if ((p = u.value) != null && p.items) {
71
+ if (B(u.value.items.const))
72
+ return u.value.items.const;
73
+ if (((k = u.value.items.enum) == null ? void 0 : k.length) === 1)
74
+ return u.value.items.enum[0];
67
75
  }
68
76
  return null;
69
- }), T = D(() => {
70
- var e, t, s, f;
71
- return Array.isArray((e = r.value) == null ? void 0 : e.type) ? r.value.type.join(" | ") : (t = r.value) != null && t.title ? r.value.title : (s = r.value) != null && s.name ? r.value.name : ((f = r.value) == null ? void 0 : f.type) ?? "";
77
+ }), F = b(() => {
78
+ var e, t, o, f;
79
+ return Array.isArray((e = u.value) == null ? void 0 : e.type) ? u.value.type.join(" | ") : (t = u.value) != null && t.title ? u.value.title : (o = u.value) != null && o.name ? u.value.name : ((f = u.value) == null ? void 0 : f.type) ?? "";
80
+ }), z = (e, t) => e === "array" ? `${e} ${t}[]` : `${e} ${t}`, $ = b(() => {
81
+ var t, o;
82
+ if (!((t = u.value) != null && t.type))
83
+ return null;
84
+ if (u.value.type === "array" && ((o = u.value.items) != null && o.type)) {
85
+ const f = M(u.value.items) || u.value.items.type;
86
+ return z(u.value.type, f);
87
+ }
88
+ const e = M(u.value);
89
+ return e || null;
72
90
  });
73
91
  return (e, t) => {
74
- var s, f, p, k, S, q, w, P, V, j, I;
75
- return l(), m("div", G, [
76
- e.$slots.name ? (l(), m("div", {
92
+ var o, f, p, k, V, q, w, D, P, I, O, A;
93
+ return r(), n("div", G, [
94
+ e.$slots.name ? (r(), n("div", {
77
95
  key: 0,
78
- class: H(["property-name", { deprecated: (s = e.value) == null ? void 0 : s.deprecated }])
96
+ class: J(["property-name", { deprecated: (o = e.value) == null ? void 0 : o.deprecated }])
79
97
  }, [
80
- e.pattern ? (l(), m(y, { key: 1 }, [
81
- t[0] || (t[0] = u("/")),
98
+ e.pattern ? (r(), n(y, { key: 1 }, [
99
+ t[0] || (t[0] = l("/")),
82
100
  E(e.$slots, "name", {}, void 0, !0),
83
- t[1] || (t[1] = u("/"))
101
+ t[1] || (t[1] = l("/"))
84
102
  ], 64)) : E(e.$slots, "name", { key: 0 }, void 0, !0)
85
103
  ], 2)) : i("", !0),
86
- e.value ? (l(), m(y, { key: 1 }, [
87
- (f = e.value) != null && f.type ? (l(), d(o, { key: 0 }, {
104
+ (f = e.value) != null && f.isDiscriminator ? (r(), n("div", K, " Discriminator ")) : i("", !0),
105
+ e.value ? (r(), n(y, { key: 2 }, [
106
+ (p = e.value) != null && p.type ? (r(), d(s, { key: 0 }, {
88
107
  default: a(() => {
89
- var M, A, C;
108
+ var C;
90
109
  return [
91
- v(b, null, {
110
+ v(j, null, {
92
111
  default: a(() => t[2] || (t[2] = [
93
- u("Type:")
112
+ l("Type:")
94
113
  ])),
95
114
  _: 1
96
115
  }),
97
- (A = (M = e.value) == null ? void 0 : M.items) != null && A.type ? (l(), m(y, { key: 0 }, [
98
- u(n(e.value.type) + " " + n(F(e.value.items) || e.value.items.type) + "[] ", 1)
99
- ], 64)) : (l(), m(y, { key: 1 }, [
100
- u(n(T.value) + " " + n((C = e.value) != null && C.nullable ? " | nullable" : ""), 1)
116
+ $.value ? (r(), n(y, { key: 0 }, [
117
+ l(m($.value), 1)
118
+ ], 64)) : (r(), n(y, { key: 1 }, [
119
+ l(m(F.value) + " " + m((C = e.value) != null && C.nullable ? " | nullable" : ""), 1)
101
120
  ], 64))
102
121
  ];
103
122
  }),
104
123
  _: 1
105
124
  })) : i("", !0),
106
- e.value.minItems || e.value.maxItems ? (l(), d(o, { key: 1 }, {
125
+ e.value.minItems || e.value.maxItems ? (r(), d(s, { key: 1 }, {
107
126
  default: a(() => [
108
- u(n(e.value.minItems) + "…" + n(e.value.maxItems), 1)
127
+ l(m(e.value.minItems) + "…" + m(e.value.maxItems), 1)
109
128
  ]),
110
129
  _: 1
111
130
  })) : i("", !0),
112
- e.value.minLength ? (l(), d(o, { key: 2 }, {
131
+ e.value.minLength ? (r(), d(s, { key: 2 }, {
113
132
  prefix: a(() => t[3] || (t[3] = [
114
- u("min:")
133
+ l("min:")
115
134
  ])),
116
135
  default: a(() => [
117
- u(" " + n(e.value.minLength), 1)
136
+ l(" " + m(e.value.minLength), 1)
118
137
  ]),
119
138
  _: 1
120
139
  })) : i("", !0),
121
- e.value.maxLength ? (l(), d(o, { key: 3 }, {
140
+ e.value.maxLength ? (r(), d(s, { key: 3 }, {
122
141
  prefix: a(() => t[4] || (t[4] = [
123
- u("max:")
142
+ l("max:")
124
143
  ])),
125
144
  default: a(() => [
126
- u(" " + n(e.value.maxLength), 1)
145
+ l(" " + m(e.value.maxLength), 1)
127
146
  ]),
128
147
  _: 1
129
148
  })) : i("", !0),
130
- e.value.uniqueItems ? (l(), d(o, { key: 4 }, {
149
+ e.value.uniqueItems ? (r(), d(s, { key: 4 }, {
131
150
  default: a(() => t[5] || (t[5] = [
132
- u(" unique! ")
151
+ l(" unique! ")
133
152
  ])),
134
153
  _: 1
135
154
  })) : i("", !0),
136
- e.value.format ? (l(), d(o, { key: 5 }, {
155
+ e.value.format ? (r(), d(s, { key: 5 }, {
137
156
  default: a(() => [
138
- v(b, null, {
157
+ v(j, null, {
139
158
  default: a(() => t[6] || (t[6] = [
140
- u("Format:")
159
+ l("Format:")
141
160
  ])),
142
161
  _: 1
143
162
  }),
144
- u(" " + n(e.value.format), 1)
163
+ l(" " + m(e.value.format), 1)
145
164
  ]),
146
165
  _: 1
147
166
  })) : i("", !0),
148
- e.value.minimum !== void 0 && e.value.exclusiveMinimum ? (l(), d(o, { key: 6 }, {
167
+ e.value.minimum !== void 0 && e.value.exclusiveMinimum ? (r(), d(s, { key: 6 }, {
149
168
  prefix: a(() => t[7] || (t[7] = [
150
- u("greater than:")
169
+ l("greater than:")
151
170
  ])),
152
171
  default: a(() => [
153
- u(" " + n(e.value.minimum), 1)
172
+ l(" " + m(e.value.minimum), 1)
154
173
  ]),
155
174
  _: 1
156
175
  })) : i("", !0),
157
- e.value.minimum !== void 0 && !e.value.exclusiveMinimum ? (l(), d(o, { key: 7 }, {
176
+ e.value.minimum !== void 0 && !e.value.exclusiveMinimum ? (r(), d(s, { key: 7 }, {
158
177
  prefix: a(() => t[8] || (t[8] = [
159
- u("min:")
178
+ l("min:")
160
179
  ])),
161
180
  default: a(() => [
162
- u(" " + n(e.value.minimum), 1)
181
+ l(" " + m(e.value.minimum), 1)
163
182
  ]),
164
183
  _: 1
165
184
  })) : i("", !0),
166
- e.value.maximum !== void 0 && e.value.exclusiveMaximum ? (l(), d(o, { key: 8 }, {
185
+ e.value.maximum !== void 0 && e.value.exclusiveMaximum ? (r(), d(s, { key: 8 }, {
167
186
  prefix: a(() => t[9] || (t[9] = [
168
- u("less than:")
187
+ l("less than:")
169
188
  ])),
170
189
  default: a(() => [
171
- u(" " + n(e.value.maximum), 1)
190
+ l(" " + m(e.value.maximum), 1)
172
191
  ]),
173
192
  _: 1
174
193
  })) : i("", !0),
175
- e.value.maximum !== void 0 && !e.value.exclusiveMaximum ? (l(), d(o, { key: 9 }, {
194
+ e.value.maximum !== void 0 && !e.value.exclusiveMaximum ? (r(), d(s, { key: 9 }, {
176
195
  prefix: a(() => t[10] || (t[10] = [
177
- u("max:")
196
+ l("max:")
178
197
  ])),
179
198
  default: a(() => [
180
- u(" " + n(e.value.maximum), 1)
199
+ l(" " + m(e.value.maximum), 1)
181
200
  ]),
182
201
  _: 1
183
202
  })) : i("", !0),
184
- e.value.pattern ? (l(), d(o, {
203
+ e.value.pattern ? (r(), d(s, {
185
204
  key: 10,
186
205
  code: "",
187
206
  truncate: ""
188
207
  }, {
189
208
  default: a(() => [
190
- v(b, null, {
209
+ v(j, null, {
191
210
  default: a(() => t[11] || (t[11] = [
192
- u("Pattern:")
211
+ l("Pattern:")
193
212
  ])),
194
213
  _: 1
195
214
  }),
196
- u(" " + n(e.value.pattern), 1)
215
+ l(" " + m(e.value.pattern), 1)
197
216
  ]),
198
217
  _: 1
199
218
  })) : i("", !0),
200
- e.$props.enum ? (l(), d(o, { key: 11 }, {
219
+ e.$props.enum ? (r(), d(s, { key: 11 }, {
201
220
  default: a(() => t[12] || (t[12] = [
202
- u("enum")
221
+ l("enum")
203
222
  ])),
204
223
  _: 1
205
224
  })) : i("", !0),
206
- e.value.default !== void 0 ? (l(), d(o, {
225
+ e.value.default !== void 0 ? (r(), d(s, {
207
226
  key: 12,
208
227
  truncate: ""
209
228
  }, {
210
229
  prefix: a(() => t[13] || (t[13] = [
211
- u("default:")
230
+ l("default:")
212
231
  ])),
213
232
  default: a(() => [
214
- u(" " + n($(e.value)), 1)
233
+ l(" " + m(T(e.value)), 1)
215
234
  ]),
216
235
  _: 1
217
236
  })) : i("", !0)
218
237
  ], 64)) : i("", !0),
219
- e.additional ? (l(), m("div", K, [
220
- (p = e.value) != null && p["x-additionalPropertiesName"] ? (l(), m(y, { key: 0 }, [
221
- u(n(e.value["x-additionalPropertiesName"]), 1)
222
- ], 64)) : (l(), m(y, { key: 1 }, [
223
- u("additional properties")
238
+ e.additional ? (r(), n("div", Q, [
239
+ (k = e.value) != null && k["x-additionalPropertiesName"] ? (r(), n(y, { key: 0 }, [
240
+ l(m(e.value["x-additionalPropertiesName"]), 1)
241
+ ], 64)) : (r(), n(y, { key: 1 }, [
242
+ l("additional properties")
224
243
  ], 64))
225
244
  ])) : i("", !0),
226
- e.pattern ? (l(), m("div", Q, [
227
- v(g(O), null, {
245
+ e.pattern ? (r(), n("div", U, [
246
+ v(N(L), null, {
228
247
  default: a(() => t[14] || (t[14] = [
229
- u("pattern")
248
+ l("pattern")
230
249
  ])),
231
250
  _: 1
232
251
  })
233
252
  ])) : i("", !0),
234
- (k = e.value) != null && k.deprecated ? (l(), m("div", U, [
235
- v(g(O), null, {
253
+ (V = e.value) != null && V.deprecated ? (r(), n("div", X, [
254
+ v(N(L), null, {
236
255
  default: a(() => t[15] || (t[15] = [
237
- u("deprecated")
256
+ l("deprecated")
238
257
  ])),
239
258
  _: 1
240
259
  })
241
260
  ])) : i("", !0),
242
- g(B)(N.value) ? (l(), m("div", W, [
243
- v(o, { truncate: "" }, {
261
+ N(B)(S.value) ? (r(), n("div", Y, [
262
+ v(s, { truncate: "" }, {
244
263
  prefix: a(() => t[16] || (t[16] = [
245
- u("const:")
264
+ l("const:")
246
265
  ])),
247
266
  default: a(() => [
248
- u(" " + n(N.value), 1)
267
+ l(" " + m(S.value), 1)
249
268
  ]),
250
269
  _: 1
251
270
  })
252
- ])) : (l(), m(y, { key: 6 }, [
253
- ((S = e.value) == null ? void 0 : S.nullable) === !0 ? (l(), d(o, { key: 0 }, {
271
+ ])) : (r(), n(y, { key: 7 }, [
272
+ ((q = e.value) == null ? void 0 : q.nullable) === !0 ? (r(), d(s, { key: 0 }, {
254
273
  default: a(() => t[17] || (t[17] = [
255
- u(" nullable ")
274
+ l(" nullable ")
256
275
  ])),
257
276
  _: 1
258
277
  })) : i("", !0)
259
278
  ], 64)),
260
- (q = e.value) != null && q.writeOnly ? (l(), m("div", X, " write-only ")) : (w = e.value) != null && w.readOnly ? (l(), m("div", Y, " read-only ")) : i("", !0),
261
- e.required ? (l(), m("div", Z, " required ")) : i("", !0),
262
- e.withExamples ? (l(), d(R, {
263
- key: 10,
279
+ (w = e.value) != null && w.writeOnly ? (r(), n("div", Z, " write-only ")) : (D = e.value) != null && D.readOnly ? (r(), n("div", h, " read-only ")) : i("", !0),
280
+ e.required ? (r(), n("div", x, " required ")) : i("", !0),
281
+ e.withExamples ? (r(), d(W, {
282
+ key: 11,
264
283
  examples: (P = e.value) == null ? void 0 : P.examples,
265
- example: ((V = e.value) == null ? void 0 : V.example) || ((I = (j = e.value) == null ? void 0 : j.items) == null ? void 0 : I.example)
284
+ example: ((I = e.value) == null ? void 0 : I.example) || ((A = (O = e.value) == null ? void 0 : O.items) == null ? void 0 : A.example)
266
285
  }, null, 8, ["examples", "example"])) : i("", !0)
267
286
  ]);
268
287
  };
269
288
  }
270
289
  });
271
290
  export {
272
- ae as default
291
+ ie as default
273
292
  };
@@ -1,4 +1,12 @@
1
1
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ export type DiscriminatorMapping = NonNullable<OpenAPIV3_1.DiscriminatorObject['mapping']>;
3
+ export type DiscriminatorPropertyName = OpenAPIV3_1.DiscriminatorObject['propertyName'];
4
+ /** Get discriminator mapping from schema */
5
+ export declare function getDiscriminatorMapping(schema: OpenAPIV3_1.SchemaObject): DiscriminatorMapping | undefined;
2
6
  /** Get discriminator property name from schema */
3
- export declare function getDiscriminatorPropertyName(schema: OpenAPIV3_1.SchemaObject): string | undefined;
7
+ export declare function getDiscriminatorPropertyName(schema: OpenAPIV3_1.SchemaObject): DiscriminatorPropertyName | undefined;
8
+ /** Check if schema has a discriminator */
9
+ export declare function hasDiscriminator(schema: OpenAPIV3_1.SchemaObject): boolean;
10
+ /** Merge discriminator schemas */
11
+ export declare function mergeDiscriminatorSchemas(baseSchema: OpenAPIV3_1.SchemaObject, selectedType: string, schemas: Record<string, OpenAPIV3_1.SchemaObject>): OpenAPIV3_1.SchemaObject | undefined;
4
12
  //# sourceMappingURL=schema-discriminator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-discriminator.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-discriminator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,kDAAkD;AAClD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,MAAM,GAAG,SAAS,CAEjG"}
1
+ {"version":3,"file":"schema-discriminator.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-discriminator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAA;AAE1F,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AAEvF,4CAA4C;AAC5C,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,oBAAoB,GAAG,SAAS,CAM1G;AAED,kDAAkD;AAClD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,yBAAyB,GAAG,SAAS,CAEpH;AAED,0CAA0C;AAC1C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,OAAO,CAE1E;AAED,kCAAkC;AAClC,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,WAAW,CAAC,YAAY,EACpC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GAChD,WAAW,CAAC,YAAY,GAAG,SAAS,CA0DtC"}
@@ -0,0 +1,45 @@
1
+ function c(r) {
2
+ var i;
3
+ if ((i = r.discriminator) != null && i.mapping)
4
+ return r.discriminator.mapping;
5
+ }
6
+ function m(r) {
7
+ var i;
8
+ return (i = r.discriminator) == null ? void 0 : i.propertyName;
9
+ }
10
+ function q(r, i, d) {
11
+ var s;
12
+ if (!((s = r.discriminator) != null && s.mapping) || !i)
13
+ return;
14
+ const u = r.discriminator.mapping[i];
15
+ if (!u)
16
+ return;
17
+ const o = u.split("/").pop();
18
+ if (!o || !d[o])
19
+ return;
20
+ const t = d[o];
21
+ if (t.allOf) {
22
+ const n = {
23
+ type: t.type,
24
+ properties: {},
25
+ required: []
26
+ }, f = {}, p = /* @__PURE__ */ new Set();
27
+ r.required && r.required.forEach((e) => p.add(e));
28
+ for (const e of t.allOf)
29
+ "properties" in e && Object.assign(f, e.properties), "required" in e && Array.isArray(e.required) && e.required.forEach((a) => p.add(a));
30
+ return n.properties = f, n.required = Array.from(p), n;
31
+ }
32
+ return {
33
+ type: t.type || r.type,
34
+ properties: {
35
+ ...r.properties || {},
36
+ ...t.properties || {}
37
+ },
38
+ required: [...r.required || [], ...t.required || []]
39
+ };
40
+ }
41
+ export {
42
+ c as getDiscriminatorMapping,
43
+ m as getDiscriminatorPropertyName,
44
+ q as mergeDiscriminatorSchemas
45
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeaderTag.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/SectionHeaderTag.vue"],"names":[],"mappings":"AAoBA,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;AASrD,iBAAS,cAAc;WA4CT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SectionHeaderTag.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/SectionHeaderTag.vue"],"names":[],"mappings":"AAmBA,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;AASrD,iBAAS,cAAc;WA4CT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SectionHeaderTag.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6f7ac329"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f1ac6c38"]]);
5
5
  export {
6
- c as default
6
+ e as default
7
7
  };