@scalar/api-reference 1.28.12 → 1.28.14

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 (48) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/browser/standalone.js +2947 -2897
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Card/Card.vue.d.ts.map +1 -1
  5. package/dist/components/Card/Card.vue.js +7 -7
  6. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  7. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
  8. package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +18 -19
  9. package/dist/components/Content/Lazy/Loading.vue.d.ts +8 -17
  10. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Lazy/Loading.vue.js +50 -44
  12. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  14. package/dist/components/Content/Schema/Schema.vue2.js +84 -71
  15. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +1 -0
  16. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +1 -1
  18. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +42 -39
  19. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -1
  20. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  22. package/dist/components/Content/Schema/SchemaProperty.vue2.js +159 -148
  23. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  24. package/dist/features/ApiClientModal/ApiClientModal.vue.js +23 -20
  25. package/dist/features/ApiClientModal/useApiClient.d.ts +308 -8
  26. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  27. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  28. package/dist/features/Operation/Operation.vue.js +29 -19
  29. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  30. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  31. package/dist/features/Operation/components/ParameterListItem.vue2.js +1 -0
  32. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  33. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  34. package/dist/features/Operation/components/RequestBody.vue2.js +29 -26
  35. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  36. package/dist/features/Search/SearchButton.vue.js +2 -2
  37. package/dist/features/Search/SearchButton.vue2.js +42 -29
  38. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  39. package/dist/features/Search/SearchModal.vue.js +3 -3
  40. package/dist/features/Search/SearchModal.vue2.js +102 -96
  41. package/dist/features/Search/useSearchIndex.d.ts +2 -1
  42. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  43. package/dist/features/Search/useSearchIndex.js +55 -52
  44. package/dist/helpers/get-request.d.ts +15 -0
  45. package/dist/helpers/get-request.d.ts.map +1 -1
  46. package/dist/index.js +1 -1
  47. package/dist/style.css +1 -1
  48. package/package.json +9 -9
@@ -1,34 +1,35 @@
1
- import { defineComponent as $, computed as u, openBlock as r, createElementBlock as i, normalizeClass as z, createBlock as b, createSlots as G, withCtx as y, createTextVNode as S, toDisplayString as d, createCommentVNode as l, createVNode as s, unref as a, Fragment as c, renderList as k, createElementVNode as f } from "vue";
2
- import { Disclosure as J, DisclosurePanel as K, DisclosureButton as Q } from "@headlessui/vue";
3
- import { ScalarMarkdown as D, ScalarIcon as W } from "@scalar/components";
4
- import { optimizeValueForDisplay as X, discriminators as I } from "./helpers/optimizeValueForDisplay.js";
1
+ import { defineComponent as $, computed as y, openBlock as o, createBlock as f, resolveDynamicComponent as G, normalizeClass as z, withCtx as m, createSlots as J, createTextVNode as D, toDisplayString as d, createCommentVNode as a, createElementBlock as i, createVNode as s, unref as l, Fragment as c, renderList as k, createElementVNode as h } from "vue";
2
+ import { Disclosure as K, DisclosurePanel as Q, DisclosureButton as W } from "@headlessui/vue";
3
+ import { ScalarMarkdown as S, ScalarIcon as X } from "@scalar/components";
4
+ import { optimizeValueForDisplay as Y, discriminators as I } from "./helpers/optimizeValueForDisplay.js";
5
5
  import L from "./Schema.vue.js";
6
6
  import O from "./SchemaDiscriminator.vue.js";
7
- import Y from "./SchemaPropertyHeading.vue.js";
8
- const x = {
7
+ import x from "./SchemaPropertyHeading.vue.js";
8
+ const ee = {
9
9
  key: 1,
10
10
  class: "property-description"
11
- }, ee = {
11
+ }, te = {
12
12
  key: 2,
13
13
  class: "property-description"
14
- }, te = {
14
+ }, ne = {
15
15
  key: 3,
16
16
  class: "property-enum"
17
- }, ne = {
17
+ }, oe = {
18
18
  key: 0,
19
19
  class: "property-list"
20
- }, re = { class: "property-heading" }, oe = { class: "property-name" }, ie = { class: "property-description" }, le = {
20
+ }, re = { class: "property-heading" }, ie = { class: "property-name" }, ae = { class: "property-description" }, se = {
21
21
  key: 1,
22
22
  class: "property-enum-values"
23
- }, se = { class: "property-enum-value-label" }, ae = { class: "property-enum-value-label" }, pe = {
23
+ }, le = { class: "property-enum-value-label" }, pe = { class: "property-enum-value-label" }, me = {
24
24
  key: 4,
25
25
  class: "children"
26
26
  }, de = {
27
27
  key: 0,
28
28
  class: "children"
29
- }, ve = /* @__PURE__ */ $({
29
+ }, be = /* @__PURE__ */ $({
30
30
  __name: "SchemaProperty",
31
31
  props: {
32
+ is: {},
32
33
  value: {},
33
34
  level: { default: 0 },
34
35
  name: {},
@@ -58,158 +59,168 @@ const x = {
58
59
  }, B = (e, n) => n != null && n.properties || n != null && n.additionalProperties || n != null && n.patternProperties || n != null && n.allOf ? null : e || (n == null ? void 0 : n.description) || null, E = (e) => !e || !H[e.type] ? null : H[e.type][e.format || "_default"], p = (e) => {
59
60
  var n;
60
61
  return (e == null ? void 0 : e.enum) || ((n = e == null ? void 0 : e.items) == null ? void 0 : n.enum) || [];
61
- }, _ = u(
62
+ }, C = y(
62
63
  () => p(t.value).length > 9
63
- ), P = u(() => _.value ? 5 : 9), U = u(
64
+ ), P = y(() => C.value ? 5 : 9), U = y(
64
65
  () => p(t.value).slice(0, P.value)
65
- ), Z = u(
66
+ ), Z = y(
66
67
  () => p(t.value).slice(P.value)
67
- ), t = u(() => X(T.value));
68
+ ), t = y(() => Y(T.value));
68
69
  I.find((e) => !t.value || typeof t.value != "object" ? !1 : e in t.value || t.value.items && typeof t.value.items == "object" && e in t.value.items);
69
- const M = (e, n, h, g, v) => n || h || g || (e == null ? void 0 : e.deprecated) || (e == null ? void 0 : e.const) || (e == null ? void 0 : e.enum) && e.enum.length === 1 || (e == null ? void 0 : e.type) || (e == null ? void 0 : e.nullable) === !0 || (e == null ? void 0 : e.writeOnly) || (e == null ? void 0 : e.readOnly) || v;
70
+ const M = (e, n, g, v, b) => n || g || v || (e == null ? void 0 : e.deprecated) || (e == null ? void 0 : e.const) || (e == null ? void 0 : e.enum) && e.enum.length === 1 || (e == null ? void 0 : e.type) || (e == null ? void 0 : e.nullable) === !0 || (e == null ? void 0 : e.writeOnly) || (e == null ? void 0 : e.readOnly) || b;
70
71
  return (e, n) => {
71
- var h, g, v, w, C, j, q, A, F, N;
72
- return r(), i("li", {
72
+ var g;
73
+ return o(), f(G(e.is ?? "li"), {
73
74
  class: z(["property", [
74
75
  (B(e.description, t.value), ""),
75
76
  `property--level-${e.level}`,
76
77
  {
77
78
  "property--compact": e.compact,
78
- "property--deprecated": (h = t.value) == null ? void 0 : h.deprecated
79
+ "property--deprecated": (g = t.value) == null ? void 0 : g.deprecated
79
80
  }
80
81
  ]])
81
- }, [
82
- M(
83
- t.value,
84
- e.name,
85
- e.additional,
86
- e.pattern,
87
- e.required
88
- ) ? (r(), b(Y, {
89
- key: 0,
90
- additional: e.additional,
91
- enum: p(t.value).length > 0,
92
- pattern: e.pattern,
93
- required: e.required,
94
- value: t.value
95
- }, G({ _: 2 }, [
96
- e.name ? {
97
- name: "name",
98
- fn: y(() => [
99
- S(d(e.name), 1)
100
- ]),
101
- key: "0"
102
- } : void 0,
103
- (g = t.value) != null && g.example ? {
104
- name: "example",
105
- fn: y(() => [
106
- S(" Example: " + d(t.value.example), 1)
107
- ]),
108
- key: "1"
109
- } : void 0
110
- ]), 1032, ["additional", "enum", "pattern", "required", "value"])) : l("", !0),
111
- B(e.description, t.value) ? (r(), i("div", x, [
112
- s(a(D), {
113
- value: B(e.description, t.value)
114
- }, null, 8, ["value"])
115
- ])) : E(t.value) ? (r(), i("div", ee, [
116
- s(a(D), {
117
- value: E(t.value) || ""
118
- }, null, 8, ["value"])
119
- ])) : l("", !0),
120
- ((v = p(t.value)) == null ? void 0 : v.length) > 0 ? (r(), i("div", te, [
121
- Array.isArray((w = t.value) == null ? void 0 : w["x-enumDescriptions"]) ? (r(), i("div", ne, [
122
- (r(!0), i(c, null, k(p(t.value), (o) => (r(), i("div", {
123
- key: o,
124
- class: "property"
125
- }, [
126
- f("div", re, [
127
- f("div", oe, d(o), 1)
128
- ]),
129
- f("div", ie, [
130
- s(a(D), {
131
- value: t.value["x-enumDescriptions"][o]
132
- }, null, 8, ["value"])
133
- ])
134
- ]))), 128))
135
- ])) : (r(), i("ul", le, [
136
- (r(!0), i(c, null, k(U.value, (o) => (r(), i("li", {
137
- key: o,
138
- class: "property-enum-value"
139
- }, [
140
- f("span", se, d(o), 1)
141
- ]))), 128)),
142
- _.value ? (r(), b(a(J), { key: 0 }, {
143
- default: y(({ open: o }) => [
144
- s(a(K), null, {
145
- default: y(() => [
146
- (r(!0), i(c, null, k(Z.value, (m) => (r(), i("li", {
147
- key: m,
148
- class: "property-enum-value"
149
- }, [
150
- f("span", ae, d(m), 1)
151
- ]))), 128))
152
- ]),
153
- _: 1
154
- }),
155
- s(a(Q), { class: "enum-toggle-button" }, {
156
- default: y(() => [
157
- s(a(W), {
158
- class: z(["enum-toggle-button-icon", { "enum-toggle-button-icon--open": o }]),
159
- icon: "Add",
160
- size: "sm"
161
- }, null, 8, ["class"]),
162
- S(" " + d(o ? "Hide values" : "Show all values"), 1)
163
- ]),
164
- _: 2
165
- }, 1024)
166
- ]),
167
- _: 1
168
- })) : l("", !0)
169
- ]))
170
- ])) : l("", !0),
171
- ((C = t.value) == null ? void 0 : C.type) === "object" && ((j = t.value) != null && j.properties || (q = t.value) != null && q.additionalProperties) ? (r(), i("div", pe, [
172
- s(L, {
173
- compact: e.compact,
174
- level: e.level + 1,
175
- value: t.value
176
- }, null, 8, ["compact", "level", "value"])
177
- ])) : l("", !0),
178
- (A = t.value) != null && A.items && typeof t.value.items == "object" && "type" in t.value.items && typeof t.value.items.type == "string" ? (r(), i(c, { key: 5 }, [
179
- ["object"].includes((N = (F = t.value) == null ? void 0 : F.items) == null ? void 0 : N.type) ? (r(), i("div", de, [
180
- s(L, {
181
- compact: e.compact,
182
- level: e.level + 1,
183
- value: t.value.items
184
- }, null, 8, ["compact", "level", "value"])
185
- ])) : l("", !0)
186
- ], 64)) : l("", !0),
187
- (r(!0), i(c, null, k(a(I), (o) => {
188
- var m, V;
189
- return r(), i(c, { key: o }, [
190
- (m = t.value) != null && m[o] ? (r(), b(O, {
82
+ }, {
83
+ default: m(() => {
84
+ var v, b, w, j, q, A, F, N, V;
85
+ return [
86
+ M(
87
+ t.value,
88
+ e.name,
89
+ e.additional,
90
+ e.pattern,
91
+ e.required
92
+ ) ? (o(), f(x, {
191
93
  key: 0,
192
- compact: e.compact,
193
- discriminator: o,
194
- hideHeading: e.hideHeading,
195
- level: e.level,
196
- schemas: e.schemas,
94
+ additional: e.additional,
95
+ enum: p(t.value).length > 0,
96
+ pattern: e.pattern,
97
+ required: e.required,
197
98
  value: t.value
198
- }, null, 8, ["compact", "discriminator", "hideHeading", "level", "schemas", "value"])) : (V = t.value) != null && V.items && typeof o == "string" && typeof t.value.items == "object" && o in t.value.items && Array.isArray(t.value.items[o]) && e.level < 3 ? (r(), b(O, {
199
- key: 1,
200
- compact: e.compact,
201
- discriminator: o,
202
- hideHeading: e.hideHeading,
203
- level: e.level,
204
- schemas: e.schemas,
205
- value: t.value.items
206
- }, null, 8, ["compact", "discriminator", "hideHeading", "level", "schemas", "value"])) : l("", !0)
207
- ], 64);
208
- }), 128))
209
- ], 2);
99
+ }, J({ _: 2 }, [
100
+ e.name ? {
101
+ name: "name",
102
+ fn: m(() => [
103
+ D(d(e.name), 1)
104
+ ]),
105
+ key: "0"
106
+ } : void 0,
107
+ (v = t.value) != null && v.example ? {
108
+ name: "example",
109
+ fn: m(() => [
110
+ D(" Example: " + d(t.value.example), 1)
111
+ ]),
112
+ key: "1"
113
+ } : void 0
114
+ ]), 1032, ["additional", "enum", "pattern", "required", "value"])) : a("", !0),
115
+ B(e.description, t.value) ? (o(), i("div", ee, [
116
+ s(l(S), {
117
+ value: B(e.description, t.value)
118
+ }, null, 8, ["value"])
119
+ ])) : E(t.value) ? (o(), i("div", te, [
120
+ s(l(S), {
121
+ value: E(t.value) || ""
122
+ }, null, 8, ["value"])
123
+ ])) : a("", !0),
124
+ ((b = p(t.value)) == null ? void 0 : b.length) > 0 ? (o(), i("div", ne, [
125
+ Array.isArray((w = t.value) == null ? void 0 : w["x-enumDescriptions"]) ? (o(), i("div", oe, [
126
+ (o(!0), i(c, null, k(p(t.value), (r) => (o(), i("div", {
127
+ key: r,
128
+ class: "property"
129
+ }, [
130
+ h("div", re, [
131
+ h("div", ie, d(r), 1)
132
+ ]),
133
+ h("div", ae, [
134
+ s(l(S), {
135
+ value: t.value["x-enumDescriptions"][r]
136
+ }, null, 8, ["value"])
137
+ ])
138
+ ]))), 128))
139
+ ])) : (o(), i("ul", se, [
140
+ (o(!0), i(c, null, k(U.value, (r) => (o(), i("li", {
141
+ key: r,
142
+ class: "property-enum-value"
143
+ }, [
144
+ h("span", le, d(r), 1)
145
+ ]))), 128)),
146
+ C.value ? (o(), f(l(K), { key: 0 }, {
147
+ default: m(({ open: r }) => [
148
+ s(l(Q), null, {
149
+ default: m(() => [
150
+ (o(!0), i(c, null, k(Z.value, (u) => (o(), i("li", {
151
+ key: u,
152
+ class: "property-enum-value"
153
+ }, [
154
+ h("span", pe, d(u), 1)
155
+ ]))), 128))
156
+ ]),
157
+ _: 1
158
+ }),
159
+ s(l(W), { class: "enum-toggle-button" }, {
160
+ default: m(() => [
161
+ s(l(X), {
162
+ class: z(["enum-toggle-button-icon", { "enum-toggle-button-icon--open": r }]),
163
+ icon: "Add",
164
+ size: "sm"
165
+ }, null, 8, ["class"]),
166
+ D(" " + d(r ? "Hide values" : "Show all values"), 1)
167
+ ]),
168
+ _: 2
169
+ }, 1024)
170
+ ]),
171
+ _: 1
172
+ })) : a("", !0)
173
+ ]))
174
+ ])) : a("", !0),
175
+ ((j = t.value) == null ? void 0 : j.type) === "object" && ((q = t.value) != null && q.properties || (A = t.value) != null && A.additionalProperties) ? (o(), i("div", me, [
176
+ s(L, {
177
+ compact: e.compact,
178
+ level: e.level + 1,
179
+ name: e.name,
180
+ value: t.value
181
+ }, null, 8, ["compact", "level", "name", "value"])
182
+ ])) : a("", !0),
183
+ (F = t.value) != null && F.items && typeof t.value.items == "object" && "type" in t.value.items && typeof t.value.items.type == "string" ? (o(), i(c, { key: 5 }, [
184
+ ["object"].includes((V = (N = t.value) == null ? void 0 : N.items) == null ? void 0 : V.type) ? (o(), i("div", de, [
185
+ s(L, {
186
+ compact: e.compact,
187
+ level: e.level + 1,
188
+ name: e.name,
189
+ value: t.value.items
190
+ }, null, 8, ["compact", "level", "name", "value"])
191
+ ])) : a("", !0)
192
+ ], 64)) : a("", !0),
193
+ (o(!0), i(c, null, k(l(I), (r) => {
194
+ var u, _;
195
+ return o(), i(c, { key: r }, [
196
+ (u = t.value) != null && u[r] ? (o(), f(O, {
197
+ key: 0,
198
+ compact: e.compact,
199
+ discriminator: r,
200
+ hideHeading: e.hideHeading,
201
+ level: e.level,
202
+ name: e.name,
203
+ schemas: e.schemas,
204
+ value: t.value
205
+ }, null, 8, ["compact", "discriminator", "hideHeading", "level", "name", "schemas", "value"])) : (_ = t.value) != null && _.items && typeof r == "string" && typeof t.value.items == "object" && r in t.value.items && Array.isArray(t.value.items[r]) && e.level < 3 ? (o(), f(O, {
206
+ key: 1,
207
+ compact: e.compact,
208
+ discriminator: r,
209
+ hideHeading: e.hideHeading,
210
+ level: e.level,
211
+ name: e.name,
212
+ schemas: e.schemas,
213
+ value: t.value.items
214
+ }, null, 8, ["compact", "discriminator", "hideHeading", "level", "name", "schemas", "value"])) : a("", !0)
215
+ ], 64);
216
+ }), 128))
217
+ ];
218
+ }),
219
+ _: 1
220
+ }, 8, ["class"]);
210
221
  };
211
222
  }
212
223
  });
213
224
  export {
214
- ve as default
225
+ be as default
215
226
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ApiClientModal/ApiClientModal.vue"],"names":[],"mappings":"AAuDA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AASzE,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC/C,CAAC;;AA6FF,wBAOG"}
1
+ {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ApiClientModal/ApiClientModal.vue"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAWzE,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC/C,CAAC;;AAwGF,wBAOG"}
@@ -1,39 +1,42 @@
1
- import { defineComponent as c, ref as p, onMounted as m, watch as f, onBeforeUnmount as s, openBlock as d, createElementBlock as v } from "vue";
2
- import { useWorkspace as x } from "@scalar/api-client/store";
1
+ import { defineComponent as m, ref as p, onMounted as f, watch as s, onBeforeUnmount as d, openBlock as v, createElementBlock as x } from "vue";
2
+ import { useWorkspace as E } from "@scalar/api-client/store";
3
3
  import { watchDebounced as g } from "@vueuse/core";
4
4
  import { useApiClient as k } from "./useApiClient.js";
5
- import { useExampleStore as C } from "../../legacy/stores/useExampleStore.js";
6
- const A = /* @__PURE__ */ c({
5
+ import { useNavState as C } from "../../hooks/useNavState.js";
6
+ import { useExampleStore as _ } from "../../legacy/stores/useExampleStore.js";
7
+ const S = /* @__PURE__ */ m({
7
8
  __name: "ApiClientModal",
8
9
  props: {
9
10
  configuration: {}
10
11
  },
11
- setup(r) {
12
- const t = p(null), { client: o, init: a } = k(), { selectedExampleKey: l, operationId: u } = C(), i = x();
13
- return m(() => {
14
- t.value && a({
15
- el: t.value,
16
- configuration: r.configuration,
17
- store: i
12
+ setup(u) {
13
+ const o = p(null), { client: t, init: i } = k(), { selectedExampleKey: l, operationId: a } = _(), c = E(), { isIntersectionEnabled: r } = C();
14
+ return f(() => {
15
+ o.value && i({
16
+ el: o.value,
17
+ configuration: u.configuration,
18
+ store: c
18
19
  });
19
20
  }), g(
20
- () => r.configuration,
21
+ () => u.configuration,
21
22
  (e) => {
22
23
  var n;
23
- return e && ((n = o.value) == null ? void 0 : n.updateConfig(e));
24
+ e && (r.value = !1, (n = t.value) == null || n.updateConfig(e), setTimeout(() => {
25
+ r.value = !0;
26
+ }, 1e3));
24
27
  },
25
28
  { deep: !0, debounce: 300 }
26
- ), f(l, (e) => {
27
- o.value && e && u.value && o.value.updateExample(e, u.value);
28
- }), s(() => {
29
+ ), s(l, (e) => {
30
+ t.value && e && a.value && t.value.updateExample(e, a.value);
31
+ }), d(() => {
29
32
  var e;
30
- return (e = o.value) == null ? void 0 : e.app.unmount();
31
- }), (e, n) => (d(), v("div", {
33
+ return (e = t.value) == null ? void 0 : e.app.unmount();
34
+ }), (e, n) => (v(), x("div", {
32
35
  ref_key: "el",
33
- ref: t
36
+ ref: o
34
37
  }, null, 512));
35
38
  }
36
39
  });
37
40
  export {
38
- A as default
41
+ S as default
39
42
  };