@scalar/api-reference 1.31.14 → 1.31.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAyRA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AAoUF,wBAOG"}
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA8QA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AA+TF,wBAOG"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as F, ref as M, computed as s, resolveComponent as T, createElementBlock as c, openBlock as r, createCommentVNode as u, createBlock as p, Fragment as N, renderList as j, createVNode as y, createElementVNode as f, unref as v, withCtx as R, toDisplayString as V } from "vue";
1
+ import { defineComponent as F, ref as M, computed as t, resolveComponent as T, createElementBlock as c, openBlock as r, createCommentVNode as u, createBlock as p, Fragment as N, renderList as j, createVNode as y, createElementVNode as f, unref as d, withCtx as R, toDisplayString as V } from "vue";
2
2
  import { ScalarListbox as Z, ScalarMarkdown as $ } from "@scalar/components";
3
3
  import { ScalarIconCaretDown as G } from "@scalar/icons";
4
4
  import { mergeAllOfSchemas as w } from "./helpers/merge-all-of-schemas.js";
@@ -22,34 +22,32 @@ const K = { class: "property-rule" }, P = {
22
22
  compact: { type: Boolean },
23
23
  hideHeading: { type: Boolean }
24
24
  },
25
- setup(a) {
26
- const d = M(0);
27
- s(() => a.value[a.composition] || []);
28
- const B = s(() => k.value), C = s(
25
+ setup(s) {
26
+ const v = M(0), B = t(() => k.value), C = t(
29
27
  () => B.value.map(
30
28
  (e, o) => ({
31
29
  id: String(o),
32
- label: J(e, a.schemas) || "Schema"
30
+ label: J(e) || "Schema"
33
31
  })
34
32
  )
35
- ), O = s({
33
+ ), O = t({
36
34
  get: () => C.value.find(
37
- (e) => e.id === String(d.value)
35
+ (e) => e.id === String(v.value)
38
36
  ),
39
- set: (e) => d.value = Number(e.id)
40
- }), D = s(() => {
37
+ set: (e) => v.value = Number(e.id)
38
+ }), D = t(() => {
41
39
  var i;
42
- const e = ["oneOf", "anyOf"].includes(a.composition), o = a.composition === "allOf" && ((i = a.value[a.composition]) == null ? void 0 : i.some((l) => b(l)));
40
+ const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) => b(l)));
43
41
  return e || o;
44
42
  }), I = (e) => e.find((o) => b(o)), L = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
45
43
  (o) => o.oneOf || o.anyOf || o.allOf
46
- ), S = (e) => e.allOf && Array.isArray(e.allOf) ? L(e) ? e : w(e.allOf) : e, k = s(() => {
47
- const e = a.value[a.composition], o = I(e);
48
- return !o || a.composition !== "allOf" && o.allOf ? e.map(S) : (o.oneOf || o.anyOf || o.allOf).map(S);
44
+ ), S = (e) => e.allOf && Array.isArray(e.allOf) ? L(e) ? e : w(e.allOf) : e, k = t(() => {
45
+ const e = s.value[s.composition], o = I(e);
46
+ return !o || s.composition !== "allOf" && o.allOf ? e.map(S) : (o.oneOf || o.anyOf || o.allOf).map(S);
49
47
  }), U = (e) => {
50
48
  var o, i;
51
49
  if (e === "allOf") {
52
- const l = (i = (o = a.value) == null ? void 0 : o[e]) == null ? void 0 : i.find(
50
+ const l = (i = (o = s.value) == null ? void 0 : o[e]) == null ? void 0 : i.find(
53
51
  (m) => b(m)
54
52
  );
55
53
  if (l != null && l.oneOf)
@@ -58,17 +56,17 @@ const K = { class: "property-rule" }, P = {
58
56
  return "Any of";
59
57
  }
60
58
  return e.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).toLowerCase().replace(/^(\w)/, (l) => l.toUpperCase());
61
- }, t = s(
62
- () => k.value[d.value]
63
- ), h = s(() => {
59
+ }, a = t(
60
+ () => k.value[v.value]
61
+ ), h = t(() => {
64
62
  var e;
65
- return (e = t.value) != null && e.oneOf ? "oneOf" : "anyOf";
66
- }), q = s(() => {
63
+ return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
64
+ }), q = t(() => {
67
65
  var o;
68
66
  const e = h.value;
69
- return (o = t.value) == null ? void 0 : o[e];
70
- }), z = s(() => {
71
- const e = t.value;
67
+ return (o = a.value) == null ? void 0 : o[e];
68
+ }), z = t(() => {
69
+ const e = a.value;
72
70
  return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
73
71
  });
74
72
  return (e, o) => {
@@ -87,7 +85,7 @@ const K = { class: "property-rule" }, P = {
87
85
  value: n
88
86
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : u("", !0),
89
87
  D.value ? (r(), c(N, { key: 1 }, [
90
- y(v(Z), {
88
+ y(d(Z), {
91
89
  modelValue: O.value,
92
90
  "onUpdate:modelValue": o[0] || (o[0] = (n) => O.value = n),
93
91
  options: C.value,
@@ -99,16 +97,16 @@ const K = { class: "property-rule" }, P = {
99
97
  f("button", P, [
100
98
  f("span", Q, V(U(e.composition)), 1),
101
99
  f("span", X, V(((n = O.value) == null ? void 0 : n.label) || "Schema"), 1),
102
- y(v(G))
100
+ y(d(G))
103
101
  ])
104
102
  ];
105
103
  }),
106
104
  _: 1
107
105
  }, 8, ["modelValue", "options"]),
108
106
  f("div", Y, [
109
- (l = t.value) != null && l.description ? (r(), c("div", W, [
110
- y(v($), {
111
- value: t.value.description
107
+ (l = a.value) != null && l.description ? (r(), c("div", W, [
108
+ y(d($), {
109
+ value: a.value.description
112
110
  }, null, 8, ["value"])
113
111
  ])) : u("", !0),
114
112
  z.value ? (r(), p(g, {
@@ -119,13 +117,13 @@ const K = { class: "property-rule" }, P = {
119
117
  name: e.name,
120
118
  noncollapsible: !0,
121
119
  schemas: e.schemas,
122
- value: (m = t.value) != null && m.properties ? {
120
+ value: (m = a.value) != null && m.properties ? {
123
121
  type: "object",
124
- properties: t.value.properties,
125
- required: t.value.required
126
- } : t.value
122
+ properties: a.value.properties,
123
+ required: a.value.required
124
+ } : a.value
127
125
  }, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : u("", !0),
128
- (A = t.value) != null && A.oneOf || (H = t.value) != null && H.anyOf ? (r(), p(i, {
126
+ (A = a.value) != null && A.oneOf || (H = a.value) != null && H.anyOf ? (r(), p(i, {
129
127
  key: 2,
130
128
  compact: e.compact,
131
129
  composition: h.value,
@@ -146,7 +144,7 @@ const K = { class: "property-rule" }, P = {
146
144
  name: e.name,
147
145
  noncollapsible: e.level == 0,
148
146
  schemas: e.schemas,
149
- value: v(w)(e.value[e.composition])
147
+ value: d(w)(e.value[e.composition])
150
148
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
151
149
  ]);
152
150
  };
@@ -1,10 +1,10 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
1
  import type { Schemas } from '../../../../features/Operation/types/schemas';
2
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
3
3
  /**
4
4
  * Extract schema name from various schema formats
5
5
  * Handles $ref, title, name, type, and schema dictionary lookup
6
6
  */
7
- export declare function getModelNameFromSchema(schema: OpenAPIV3_1.SchemaObject, schemas?: Schemas): string | null;
7
+ export declare function getModelNameFromSchema(schema: OpenAPIV3_1.SchemaObject): string | null;
8
8
  /**
9
9
  * Find schema name by matching against component schemas
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAuDzG;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA8B3G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,OAAO,EACjB,cAAc,UAAQ,EACtB,0BAA0B,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,GAC7E,MAAM,GAAG,IAAI,CA2Df;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAgBpD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,CAAC,YAAY,EAAE,EACvC,kBAAkB,EAAE,WAAW,CAAC,YAAY,EAAE,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,WAAW,CAAC,YAAY,EAAE,CA0B5B"}
1
+ {"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGxD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,MAAM,GAAG,IAAI,CA6CtF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAwB3G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,OAAO,EACjB,cAAc,UAAQ,EACtB,0BAA0B,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,GAC7E,MAAM,GAAG,IAAI,CA2Df;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAgBpD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,CAAC,YAAY,EAAE,EACvC,kBAAkB,EAAE,WAAW,CAAC,YAAY,EAAE,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,WAAW,CAAC,YAAY,EAAE,CA0B5B"}
@@ -1,16 +1,11 @@
1
- import { stringify as p } from "flatted";
2
- function m(t, r) {
1
+ import { stringify as $ } from "flatted";
2
+ function s(t) {
3
3
  if (!t)
4
4
  return null;
5
5
  if ("title" in t && t.title)
6
6
  return t.title;
7
7
  if ("name" in t && t.name)
8
8
  return t.name;
9
- if (r && typeof r == "object") {
10
- for (const [i, n] of Object.entries(r))
11
- if (p(n) === p(t))
12
- return i;
13
- }
14
9
  if ("$ref" in t) {
15
10
  const n = t.$ref.match(/\/([^\/]+)$/);
16
11
  if (n)
@@ -21,56 +16,52 @@ function m(t, r) {
21
16
  if ("type" in t && t.type)
22
17
  return Array.isArray(t.type) ? t.type.join(" | ") : t.type;
23
18
  if (typeof t == "object") {
24
- const i = Object.keys(t);
25
- if (i.length > 0)
26
- return i[0];
19
+ const r = Object.keys(t);
20
+ if (r.length > 0)
21
+ return r[0];
27
22
  }
28
23
  return null;
29
24
  }
30
- function $(t, r) {
31
- var i, n;
32
- if (!t || !r || typeof r != "object")
25
+ function b(t, r) {
26
+ var n, y;
27
+ if (!t || !r || typeof r != "object" || t.type !== "array" && t.type !== "object")
33
28
  return null;
34
- for (const [e, y] of Object.entries(r))
35
- if (y.type === t.type && (t.type === "array" && ((i = y.items) == null ? void 0 : i.type) === ((n = t.items) == null ? void 0 : n.type) || t.type === "object" && y.properties && t.properties && p(y.properties) === p(t.properties) || t.type !== "array" && t.type !== "object" && b(e)))
29
+ for (const [e, i] of Object.entries(r))
30
+ if (i.type === t.type && (t.type === "array" && ((n = i.items) == null ? void 0 : n.type) === ((y = t.items) == null ? void 0 : y.type) || t.type === "object" && i.properties && t.properties && $(i.properties) === $(t.properties)))
36
31
  return e;
37
32
  return null;
38
33
  }
39
- function f(t, r) {
34
+ function p(t, r) {
40
35
  return t === "array" ? `${t} ${r}[]` : `${t} ${r}`;
41
36
  }
42
- function d(t, r, i = !1, n) {
43
- var s;
37
+ function u(t, r, n = !1, y) {
38
+ var o;
44
39
  if (!(t != null && t.type))
45
40
  return null;
46
- if (i)
47
- return t.type === "array" && ((s = t.items) != null && s.type) ? `array ${t.items.type}[]` : null;
48
- const e = m(t, r);
41
+ if (n)
42
+ return t.type === "array" && ((o = t.items) != null && o.type) ? `array ${t.items.type}[]` : null;
43
+ const e = s(t);
49
44
  if (e && (t.title || t.name))
50
45
  return t.type === "array" ? `array ${e}[]` : e;
51
- const y = $(t, r);
52
- if (y)
53
- return t.type === "array" ? `array ${y}[]` : y;
46
+ const i = b(t, r);
47
+ if (i)
48
+ return t.type === "array" ? `array ${i}[]` : i;
54
49
  if (t.type === "array" && t.items) {
55
- if (n) {
56
- const u = n(t.items, r);
57
- if (u)
58
- return f(t.type, u);
50
+ if (y) {
51
+ const m = y(t.items, r);
52
+ if (m)
53
+ return p(t.type, m);
59
54
  }
60
55
  if (t.items.title || t.items.name)
61
- return f(t.type, t.items.title || t.items.name);
62
- const o = m(t.items, r);
63
- return o && o !== t.items.type ? f(t.type, o) : t.items.type ? f(t.type, t.items.type) : f(t.type, "object");
56
+ return p(t.type, t.items.title || t.items.name);
57
+ const f = s(t.items);
58
+ return f && f !== t.items.type ? p(t.type, f) : t.items.type ? p(t.type, t.items.type) : p(t.type, "object");
64
59
  }
65
60
  return e && e !== t.type ? e.startsWith("Array of ") ? `array ${e.replace("Array of ", "")}[]` : e : null;
66
61
  }
67
- function b(t) {
68
- return !t || ["anyOf", "oneOf", "allOf"].includes(t) ? !1 : /[A-Z]/.test(t) || /\s/.test(t) || /\(\d+\)/.test(t);
69
- }
70
62
  export {
71
- f as formatTypeWithModel,
72
- d as getModelName,
73
- m as getModelNameFromSchema,
74
- $ as getSchemaNameFromSchemas,
75
- b as hasName
63
+ p as formatTypeWithModel,
64
+ u as getModelName,
65
+ s as getModelNameFromSchema,
66
+ b as getSchemaNameFromSchemas
76
67
  };
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "vue",
21
21
  "vue3"
22
22
  ],
23
- "version": "1.31.14",
23
+ "version": "1.31.15",
24
24
  "engines": {
25
25
  "node": ">=20"
26
26
  },
@@ -54,15 +54,15 @@
54
54
  "nanoid": "^5.1.5",
55
55
  "vue": "^3.5.12",
56
56
  "zod": "3.24.1",
57
- "@scalar/api-client": "2.5.8",
57
+ "@scalar/api-client": "2.5.9",
58
+ "@scalar/code-highlight": "0.1.4",
59
+ "@scalar/components": "0.14.10",
58
60
  "@scalar/helpers": "0.0.4",
59
61
  "@scalar/icons": "0.4.3",
60
- "@scalar/components": "0.14.9",
61
- "@scalar/code-highlight": "0.1.4",
62
- "@scalar/oas-utils": "0.4.5",
63
62
  "@scalar/openapi-types": "0.3.3",
64
- "@scalar/snippetz": "0.3.1",
63
+ "@scalar/oas-utils": "0.4.6",
65
64
  "@scalar/openapi-parser": "0.18.0",
65
+ "@scalar/snippetz": "0.3.1",
66
66
  "@scalar/themes": "0.13.3",
67
67
  "@scalar/types": "0.2.3",
68
68
  "@scalar/use-hooks": "0.2.2",
@@ -84,9 +84,9 @@
84
84
  "vite-plugin-banner": "^0.7.1",
85
85
  "vite-plugin-css-injected-by-js": "^3.4.0",
86
86
  "vitest": "^1.6.0",
87
- "@scalar/build-tooling": "0.2.3",
88
87
  "@scalar/galaxy": "0.5.1",
89
- "@scalar/react-renderer": "0.2.0"
88
+ "@scalar/react-renderer": "0.2.0",
89
+ "@scalar/build-tooling": "0.2.3"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "pnpm build:default && pnpm build:standalone && pnpm types:build && tsc-alias -p tsconfig.build.json",