@scalar/api-reference 1.35.2 → 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 (166) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/browser/standalone.js +9636 -9786
  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 +10 -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 +93 -141
  37. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +19 -4
  38. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  39. package/dist/components/Content/Schema/SchemaComposition.vue.js +83 -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 +9 -14
  49. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  50. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +62 -75
  51. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +8 -13
  52. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  53. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  54. package/dist/components/Content/Schema/SchemaProperty.vue2.js +120 -140
  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 +1 -1
  109. package/dist/features/Operation/components/ParameterListItem.vue2.js +78 -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 +2 -2
  113. package/dist/features/Operation/components/RequestBody.vue2.js +78 -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/features/api-client-modal/useApiClient.d.ts +90 -90
  134. package/dist/index.js +1 -1
  135. package/dist/libs/openapi.d.ts +1 -13
  136. package/dist/libs/openapi.d.ts.map +1 -1
  137. package/dist/libs/openapi.js +39 -56
  138. package/dist/style.css +1 -1
  139. package/dist/v2/ApiReferenceWorkspace.vue.d.ts +10 -4
  140. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  141. package/dist/v2/ApiReferenceWorkspace.vue.js +22 -18
  142. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +1 -1
  143. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  144. package/package.json +13 -13
  145. package/dist/components/Content/Schema/Schema.preview.d.ts +0 -1078
  146. package/dist/components/Content/Schema/Schema.preview.d.ts.map +0 -1
  147. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +0 -12
  148. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +0 -1
  149. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +0 -49
  150. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +0 -4
  151. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +0 -13
  152. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +0 -1
  153. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +0 -1
  154. package/dist/features/Operation/components/ParameterHeaders.vue.js +0 -7
  155. package/dist/features/Operation/components/ParameterHeaders.vue2.js +0 -64
  156. package/dist/features/Operation/components/ParameterList.vue3.js +0 -4
  157. package/dist/features/Operation/hooks/useResponses.d.ts +0 -17
  158. package/dist/features/Operation/hooks/useResponses.d.ts.map +0 -1
  159. package/dist/features/Operation/hooks/useResponses.js +0 -19
  160. package/dist/hooks/useDiscriminator.d.ts +0 -53
  161. package/dist/hooks/useDiscriminator.d.ts.map +0 -1
  162. package/dist/hooks/useDiscriminator.js +0 -149
  163. package/dist/hooks/useOperationDiscriminator.d.ts +0 -8
  164. package/dist/hooks/useOperationDiscriminator.d.ts.map +0 -1
  165. package/dist/hooks/useOperationDiscriminator.js +0 -57
  166. /package/dist/features/Operation/components/{ParameterHeaders.vue3.js → Headers.vue3.js} +0 -0
@@ -1,92 +1,138 @@
1
- function n(f, i, p = 0) {
2
- if (p >= 20 || !Array.isArray(f) || f.length === 0)
3
- return i || {};
4
- const e = f.reduce((t, r) => {
5
- if (!r || typeof r != "object")
6
- return t;
7
- if (r.allOf) {
8
- const s = n(r.allOf, void 0, p + 1);
9
- return n([t, s], void 0, p + 1);
1
+ import { objectKeys as y } from "@scalar/helpers/object/object-keys";
2
+ import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
+ import { isArraySchema as m } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
4
+ const a = (e, f) => {
5
+ var i;
6
+ if (!((i = e == null ? void 0 : e.allOf) != null && i.length) || !Array.isArray(e.allOf))
7
+ return f || {};
8
+ const t = {}, { allOf: n, ...r } = e;
9
+ for (const o of e.allOf) {
10
+ if (!o || typeof o != "object")
11
+ continue;
12
+ const p = s(o);
13
+ if (p.allOf) {
14
+ const l = a(p);
15
+ O(t, l);
16
+ continue;
10
17
  }
11
- const o = typeof t == "object" ? { ...t } : {};
12
- if (r.properties && (o.properties = l(o.properties || {}, r.properties, p + 1)), r.items) {
13
- if (r.type === "array")
14
- o.items = d(o.items || {}, r.items, p + 1);
15
- else if (typeof r.type == "string" && ["object", "string"].includes(r.type) && r.items.allOf) {
16
- const s = n(r.items.allOf, void 0, p + 1);
17
- o.properties = l(
18
- o.properties || {},
19
- s.properties || {},
20
- p + 1
21
- );
22
- }
23
- }
24
- return O(o, r, p + 1);
25
- }, {});
26
- return i ? O(e, i, p + 1) : e;
27
- }
28
- function l(f, i, p = 0) {
29
- if (p >= 20)
30
- return f;
31
- const e = typeof f == "object" ? { ...f } : {};
32
- return Object.entries(i).forEach(([t, r]) => {
33
- var o;
34
- if (!r || typeof r != "object") {
35
- e[t] = r;
36
- return;
37
- }
38
- if (!e[t]) {
39
- r.type === "array" && ((o = r.items) != null && o.allOf) ? e[t] = {
40
- ...r,
41
- items: n(r.items.allOf, void 0, p + 1)
42
- } : r.allOf ? e[t] = n(r.allOf, void 0, p + 1) : e[t] = r;
43
- return;
18
+ O(t, p);
19
+ }
20
+ if (Object.keys(r).length > 0 && O(t, r, !0), f && typeof f == "object")
21
+ if (f.allOf) {
22
+ const o = a(f);
23
+ O(t, o, !0);
24
+ } else
25
+ O(t, f, !0);
26
+ return t;
27
+ }, O = (e, f, t = !1) => {
28
+ var r;
29
+ const n = y(f);
30
+ if (n.length !== 0)
31
+ for (const i of n) {
32
+ const o = s(f[i]);
33
+ if (o !== void 0)
34
+ if (i === "required")
35
+ Array.isArray(o) && o.length > 0 && ((r = e.required) != null && r.length ? e.required = [.../* @__PURE__ */ new Set([...e.required, ...o])] : e.required = o.slice());
36
+ else if (i === "properties")
37
+ o && typeof o == "object" && (e.properties || (e.properties = {}), c(e.properties, o));
38
+ else if (i === "items") {
39
+ const p = s(o);
40
+ if (p)
41
+ if (m(f))
42
+ if (e.items || (e.items = {}), p.allOf) {
43
+ const l = a(p);
44
+ Object.assign(e.items, l);
45
+ } else
46
+ d(s(e.items), p);
47
+ else if (p.allOf) {
48
+ const l = a(p);
49
+ "properties" in l && ("properties" in e || (e.properties = {}), "properties" in e && c(e.properties, l.properties));
50
+ } else "items" in e || (e.items = p);
51
+ } else if (i === "enum")
52
+ Array.isArray(o) && o.length > 0 && (e.enum = [.../* @__PURE__ */ new Set([...e.enum || [], ...o])]);
53
+ else if (i === "oneOf" || i === "anyOf") {
54
+ if (Array.isArray(o)) {
55
+ "properties" in e || (e.properties = {});
56
+ for (const p of o) {
57
+ const l = s(p);
58
+ l.properties && "properties" in e && c(e.properties, l.properties);
59
+ }
60
+ }
61
+ } else {
62
+ if (i === "allOf")
63
+ continue;
64
+ (t || e[i] === void 0) && (e[i] = o);
65
+ }
44
66
  }
45
- if (r.allOf)
46
- e[t] = n([e[t], ...r.allOf], void 0, p + 1);
47
- else if (r.type === "array" && r.items)
48
- e[t] = {
49
- ...e[t],
50
- type: "array",
51
- items: d(e[t].items || {}, r.items, p + 1)
52
- };
53
- else {
54
- const s = e[t].properties || r.properties ? l(e[t].properties || {}, r.properties || {}, p + 1) : void 0;
55
- e[t] = {
56
- ...e[t],
57
- ...r
58
- }, s && (e[t].properties = s);
67
+ }, c = (e, f) => {
68
+ var n;
69
+ const t = Object.keys(f ?? {});
70
+ if (!(!f || !e || t.length === 0))
71
+ for (const r of t) {
72
+ const i = s(f[r]);
73
+ if (!i || typeof i != "object") {
74
+ e[r] = i;
75
+ continue;
76
+ }
77
+ if (!e[r]) {
78
+ i.allOf ? e[r] = a(i) : "type" in i && i.type === "array" && ((n = s(i.items)) != null && n.allOf) ? e[r] = {
79
+ ...i,
80
+ items: a(s(i.items))
81
+ } : e[r] = f[r];
82
+ continue;
83
+ }
84
+ const o = s(e[r]);
85
+ if (i.allOf)
86
+ e[r] = a({ allOf: [o, ...i.allOf] });
87
+ else if (m(i) && m(o) && i.items) {
88
+ const p = s(o.items);
89
+ e[r] = {
90
+ ...o,
91
+ type: "array",
92
+ items: p ? h(p, s(i.items)) : s(i.items)
93
+ };
94
+ } else if ("properties" in o && "properties" in i) {
95
+ const p = { ...o, ...i };
96
+ p.properties = { ...o.properties }, c(p.properties, i.properties), e[r] = p;
97
+ } else
98
+ e[r] = { ...i, ...o };
59
99
  }
60
- }), e;
61
- }
62
- function d(f, i, p = 0) {
63
- if (p >= 20)
64
- return f;
65
- if (f.allOf || i.allOf) {
66
- const t = [...f.allOf || [f], ...i.allOf || [i]];
67
- return n(t, void 0, p + 1);
100
+ }, d = (e, f) => {
101
+ if (f.allOf || e.allOf) {
102
+ const t = [];
103
+ if (e.allOf)
104
+ for (const r of e.allOf)
105
+ t.push(s(r));
106
+ else
107
+ t.push(e);
108
+ if (f.allOf)
109
+ for (const r of f.allOf)
110
+ t.push(s(r));
111
+ else
112
+ t.push(f);
113
+ const n = a({ allOf: t });
114
+ Object.assign(e, n);
115
+ return;
68
116
  }
69
- const e = {
70
- ...f,
71
- ...i
72
- };
73
- return f.properties && i.properties && (e.properties = l(f.properties, i.properties, p + 1)), e;
74
- }
75
- const O = (f, i, p = 0) => {
76
- if (p >= 20)
77
- return f;
78
- const e = typeof f == "object" ? { ...f } : {};
79
- if (i.required && Array.isArray(i.required)) {
80
- const t = f.required || [], r = i.required;
81
- e.required = [.../* @__PURE__ */ new Set([...t, ...r])];
117
+ Object.assign(e, f), "properties" in e && "properties" in f && c(e.properties, f.properties);
118
+ }, h = (e, f) => {
119
+ if (e.allOf || f.allOf) {
120
+ const n = [];
121
+ if (e.allOf)
122
+ for (const r of e.allOf)
123
+ n.push(s(r));
124
+ else
125
+ n.push(e);
126
+ if (f.allOf)
127
+ for (const r of f.allOf)
128
+ n.push(s(r));
129
+ else
130
+ n.push(f);
131
+ return a({ allOf: n });
82
132
  }
83
- return i.type && !f.type && (e.type = i.type), i.title && !f.title && (e.title = i.title), i.name && !f.name && (e.name = i.name), i.description && !f.description && (e.description = i.description), i.properties && (e.properties = l(e.properties || {}, i.properties, p + 1)), ["oneOf", "anyOf"].forEach((t) => {
84
- const r = i[t];
85
- r && r.forEach((o) => {
86
- o.properties && (e.properties = l(e.properties || {}, o.properties, p + 1));
87
- });
88
- }), e;
133
+ const t = { ...e, ...f };
134
+ return "properties" in e && "properties" in f && (t.properties = { ...e.properties }, c(t.properties, f.properties)), t;
89
135
  };
90
136
  export {
91
- n as mergeAllOfSchemas
137
+ a as mergeAllOfSchemas
92
138
  };
@@ -1,8 +1,8 @@
1
- import type { UnknownObject } from '@scalar/types/utils';
2
- import type { CompositionKeyword } from './schema-composition.js';
3
- export declare const compositions: CompositionKeyword[];
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
2
  /**
5
- * Optimize the value by removing nulls from compositions.
3
+ * Optimize the value by removing nulls from compositions and merging root properties.
4
+ *
5
+ * TODO: figure out what this does
6
6
  */
7
- export declare function optimizeValueForDisplay(value: UnknownObject | undefined): Record<string, any> | undefined;
7
+ export declare function optimizeValueForDisplay(value: SchemaObject | undefined): SchemaObject | undefined;
8
8
  //# sourceMappingURL=optimize-value-for-display.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"optimize-value-for-display.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,eAAO,MAAM,YAAY,EAAE,kBAAkB,EAAuC,CAAA;AAEpF;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CA2GzG"}
1
+ {"version":3,"file":"optimize-value-for-display.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIhG;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAuFjG"}
@@ -1,34 +1,43 @@
1
- import { mergeAllOfSchemas as y } from "./merge-all-of-schemas.js";
2
- const d = ["oneOf", "anyOf", "allOf", "not"];
3
- function b(e) {
4
- var O;
5
- if (!e || typeof e != "object")
6
- return e;
7
- let r = { ...e };
8
- const o = d.find((t) => r == null ? void 0 : r[t]);
9
- if (!o || o === "not")
10
- return r;
11
- const s = r == null ? void 0 : r[o];
12
- if (!Array.isArray(s))
13
- return r;
14
- const i = { ...r };
15
- delete i[o], delete i.nullable;
16
- const u = Object.keys(i).length > 0, c = (o === "oneOf" || o === "anyOf") && (s.some((t) => t.allOf) || u), p = s.map((t) => {
17
- if (t.allOf && Array.isArray(t.allOf)) {
18
- let l = y(t.allOf);
19
- return c && (l = y(t.allOf, i)), Object.keys(t).forEach((n) => {
20
- !d.includes(n) && !(n in l) && (l[n] = t[n]);
21
- }), l;
22
- }
23
- return c && !t.allOf ? { ...i, ...t } : t;
24
- });
25
- p.some((t) => t.type === "null") && (r.nullable = !0);
26
- const f = p.filter((t) => t.type !== "null");
27
- return f.length === 1 && (r != null && r[o]) ? (r = { ...r, ...f[0] }, r == null || delete r[o], r) : c ? (r = {
28
- [o]: f
29
- }, r.nullable && (r.nullable = !0), r) : (Array.isArray(r == null ? void 0 : r[o]) && ((O = r == null ? void 0 : r[o]) == null ? void 0 : O.length) > 1 && (r[o] = f), r);
1
+ import { getResolvedRef as h } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
+ import { compositions as b } from "./schema-composition.js";
3
+ function P(t) {
4
+ if (!t || typeof t != "object")
5
+ return t;
6
+ const r = b.find((e) => e in t && e !== "not");
7
+ if (!r)
8
+ return { ...t };
9
+ const i = t[r];
10
+ if (!Array.isArray(i))
11
+ return { ...t };
12
+ const { [r]: S, nullable: m, ...n } = t, a = Object.keys(n).length > 0, { filteredSchemas: o, hasNullSchema: p } = i.reduce(
13
+ (e, l) => {
14
+ const s = h(l);
15
+ return "type" in s && s.type === "null" ? e.hasNullSchema = !0 : e.filteredSchemas.push(s), e;
16
+ },
17
+ { filteredSchemas: [], hasNullSchema: !1 }
18
+ ), c = p || m === !0;
19
+ if (o.length === 1) {
20
+ const e = { ...n, ...o[0] };
21
+ return c && (e.nullable = !0), e;
22
+ }
23
+ if ((r === "oneOf" || r === "anyOf") && (a || o.some((e) => e.allOf))) {
24
+ const e = o.map((s) => {
25
+ var u;
26
+ const f = h(s);
27
+ if (((u = f.allOf) == null ? void 0 : u.length) === 1) {
28
+ const { allOf: g, ...d } = f;
29
+ return { ...n, ...d, ...h(g[0]) };
30
+ }
31
+ return { ...n, ...f };
32
+ }), l = { [r]: e };
33
+ return c && (l.nullable = !0), l;
34
+ }
35
+ if (o.length !== i.length) {
36
+ const e = { ...t, [r]: o };
37
+ return c && (e.nullable = !0), e;
38
+ }
39
+ return { ...t };
30
40
  }
31
41
  export {
32
- d as compositions,
33
- b as optimizeValueForDisplay
42
+ P as optimizeValueForDisplay
34
43
  };
@@ -1,12 +1,4 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
- export type CompositionMapping = {
3
- [key: string]: string;
4
- };
5
1
  /** Composition */
6
2
  export type CompositionKeyword = 'oneOf' | 'anyOf' | 'allOf' | 'not';
7
3
  export declare const compositions: CompositionKeyword[];
8
- /** Get composition mapping from schema - used in testing */
9
- export declare function getCompositionSchemaMapping(schema: OpenAPIV3_1.SchemaObject, composition: CompositionKeyword): CompositionMapping | undefined;
10
- /** Check if schema has a composition keyword */
11
- export declare function hasComposition(schema: OpenAPIV3_1.SchemaObject): boolean;
12
4
  //# sourceMappingURL=schema-composition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-composition.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-composition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB,CAAA;AAED,kBAAkB;AAClB,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAA;AAEpE,eAAO,MAAM,YAAY,EAAE,kBAAkB,EAAuC,CAAA;AAEpF,4DAA4D;AAC5D,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,WAAW,CAAC,YAAY,EAChC,WAAW,EAAE,kBAAkB,GAC9B,kBAAkB,GAAG,SAAS,CAuBhC;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,OAAO,CAExE"}
1
+ {"version":3,"file":"schema-composition.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-composition.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAA;AAEpE,eAAO,MAAM,YAAY,EAAE,kBAAkB,EAAuC,CAAA"}
@@ -1,8 +1,4 @@
1
- const t = ["oneOf", "anyOf", "allOf", "not"];
2
- function i(o) {
3
- return t.some((n) => o[n] !== void 0);
4
- }
1
+ const o = ["oneOf", "anyOf", "allOf", "not"];
5
2
  export {
6
- t as compositions,
7
- i as hasComposition
3
+ o as compositions
8
4
  };
@@ -1,29 +1,20 @@
1
- import type { Schemas } from '../../../../features/Operation/types/schemas';
2
- 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';
3
3
  /**
4
4
  * Extract schema name from various schema formats
5
+ *
5
6
  * Handles $ref, title, name, type, and schema dictionary lookup
6
7
  */
7
- export declare function getModelNameFromSchema(schema: OpenAPIV3_1.SchemaObject): string | null;
8
- /**
9
- * Find schema name by matching against component schemas
10
- */
11
- export declare function getSchemaNameFromSchemas(schema: OpenAPIV3_1.SchemaObject, schemas?: Schemas): string | null;
8
+ export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | ReferenceType<SchemaObject>) => string | null;
12
9
  /**
13
10
  * Format the type and model name for display
14
11
  */
15
- export declare function formatTypeWithModel(type: string, modelName: string): string;
12
+ export declare const formatTypeWithModel: (type: Extract<SchemaObject, {
13
+ type: any;
14
+ }>["type"], modelName: string) => string;
16
15
  /**
17
16
  * Get the model name for a schema property
18
17
  * e.g. User | Admin | array of User | array of Admin
19
18
  */
20
- export declare function getModelName(value: Record<string, any>, schemas?: Schemas, hideModelNames?: boolean, getDiscriminatorSchemaName?: (schema: any, schemas?: Schemas) => string | null): string | null;
21
- /**
22
- * Check if a schema has a name (title, name, or custom identifier)
23
- */
24
- export declare function hasName(name: string | null): boolean;
25
- /**
26
- * Choose the schemas to display in composition panel
27
- */
28
- export declare function getCompositionDisplay(baseSchemas: OpenAPIV3_1.SchemaObject[], compositionSchemas: OpenAPIV3_1.SchemaObject[], _schemas?: Schemas): OpenAPIV3_1.SchemaObject[];
19
+ export declare const getModelName: (value: SchemaObject, hideModelNames?: boolean) => string | null;
29
20
  //# sourceMappingURL=schema-name.d.ts.map
@@ -1 +1 @@
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,CAyBtF;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,CAmDf;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,QAAQ,CAAC,EAAE,OAAO,GACjB,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":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAI1F;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MAAM,GAAG,IAyBzG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,MAAM,KAAG,MACrD,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,YAAY,EAAE,wBAAsB,KAAG,MAAM,GAAG,IA+CnF,CAAA"}
@@ -1,41 +1,32 @@
1
- function o(t) {
1
+ import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
+ import { getRefName as y } from "./get-ref-name.js";
3
+ const f = (t) => {
2
4
  if (!t)
3
5
  return null;
4
- if ("title" in t && t.title)
5
- return t.title;
6
- if ("name" in t && t.name)
7
- return t.name;
8
6
  if ("$ref" in t) {
9
- const i = t.$ref.match(/\/([^\/]+)$/);
10
- if (i)
11
- return i[1];
7
+ const e = y(t);
8
+ if (e)
9
+ return e;
12
10
  }
13
- return null;
14
- }
15
- function e(t, n) {
16
- return t === "array" ? `${t} ${n}[]` : `${t} ${n}`;
17
- }
18
- function p(t, n, i = !1, y) {
19
- if (!(t != null && t.type) || i)
11
+ const r = s(t);
12
+ return r.title ? r.title : r.name ? r.name : null;
13
+ }, o = (t, r) => `${t} ${r}${t === "array" ? "[]" : ""}`, u = (t, r = !1) => {
14
+ if (!("type" in t) || r)
20
15
  return null;
21
- const r = o(t);
22
- if (r && (t.title || t.name))
23
- return t.type === "array" ? `array ${r}[]` : r;
24
- if (t.type === "array" && t.items) {
25
- if (y) {
26
- const m = y(t.items, n);
27
- if (m)
28
- return e(t.type, m);
29
- }
30
- if (t.items.title || t.items.name)
31
- return e(t.type, t.items.title || t.items.name);
32
- const f = o(t.items);
33
- return f && f !== t.items.type ? e(t.type, f) : t.items.type ? e(t.type, t.items.type) : e(t.type, "object");
16
+ const e = t.type, i = f(t);
17
+ if (i && t.title)
18
+ return e === "array" ? `array ${i}[]` : i;
19
+ if (e === "array" && t.items) {
20
+ const n = s(t.items), a = n.title;
21
+ if (a)
22
+ return o(e, a);
23
+ const m = f(t.items);
24
+ return m && "type" in n && m !== n.type ? o(e, m) : "type" in n ? o(e, Array.isArray(n.type) ? n.type.join(" | ") : n.type) : o(e, "object");
34
25
  }
35
- return r && r !== t.type ? r.startsWith("Array of ") ? `array ${r.replace("Array of ", "")}[]` : r : null;
36
- }
26
+ return i && i !== e ? i.startsWith("Array of ") ? `array ${i.slice(9)}[]` : i : null;
27
+ };
37
28
  export {
38
- e as formatTypeWithModel,
39
- p as getModelName,
40
- o as getModelNameFromSchema
29
+ o as formatTypeWithModel,
30
+ u as getModelName,
31
+ f as getModelNameFromSchema
41
32
  };
@@ -1,22 +1,21 @@
1
1
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
2
  import type { Collection, Server } from '@scalar/oas-utils/entities/spec';
3
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
4
3
  import type { ApiReferenceConfiguration } from '@scalar/types';
5
4
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
5
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
6
6
  import type { ClientOptionGroup } from '../../v2/blocks/scalar-request-example-block/types';
7
7
  type __VLS_Props = {
8
8
  path: string;
9
9
  method: HttpMethod;
10
10
  clientOptions: ClientOptionGroup[];
11
+ config: ApiReferenceConfiguration;
12
+ document: OpenApiDocument;
11
13
  isWebhook: boolean;
12
14
  id: string;
13
- config: ApiReferenceConfiguration;
14
15
  server: Server | undefined;
15
16
  store: WorkspaceStore;
16
17
  /** @deprecated Use `document` instead, we just need the selected security scheme uids for now */
17
18
  collection: Collection;
18
- /** @deprecated Use the new workspace store instead*/
19
- document?: OpenAPIV3_1.Document;
20
19
  };
21
20
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
21
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AAoIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAOpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AAKvF,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;IAClB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,SAAS,EAAE,OAAO,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,yBAAyB,CAAA;IACjC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,cAAc,CAAA;IACrB,iGAAiG;IACjG,UAAU,EAAE,UAAU,CAAA;IACtB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAA;CAChC,CAAC;;AAkLJ,wBAMG"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AA4GA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AAKvF,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;IAClB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,MAAM,EAAE,yBAAyB,CAAA;IACjC,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,cAAc,CAAA;IACrB,iGAAiG;IACjG,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;AA0IJ,wBAMG"}