@scalar/api-reference 1.25.65 → 1.25.67

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 (26) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/browser/standalone.js +14164 -14242
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.js +21 -21
  5. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  6. package/dist/components/Content/Schema/SchemaProperty.vue.js +3 -3
  7. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  9. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +7 -10
  10. package/dist/components/Layouts/ModernLayout.vue.js +2 -2
  11. package/dist/components/Layouts/ModernLayout.vue2.js +16 -16
  12. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  13. package/dist/features/ApiClientModal/ApiClientModal.vue.js +25 -22
  14. package/dist/features/ApiClientModal/useApiClient.d.ts +2 -0
  15. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  16. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  17. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  18. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +71 -70
  19. package/dist/index.js +1 -1
  20. package/dist/legacy/stores/index.d.ts +1 -0
  21. package/dist/legacy/stores/index.d.ts.map +1 -1
  22. package/dist/legacy/stores/useExampleStore.d.ts +5 -0
  23. package/dist/legacy/stores/useExampleStore.d.ts.map +1 -0
  24. package/dist/legacy/stores/useExampleStore.js +8 -0
  25. package/dist/style.css +1 -1
  26. package/package.json +11 -11
@@ -1,51 +1,52 @@
1
- import { defineComponent as Y, ref as O, useId as D, computed as d, watch as z, inject as G, onServerPrefetch as Q, useSSRContext as W, unref as r, openBlock as c, createBlock as g, withCtx as a, createVNode as l, createElementBlock as K, Fragment as R, createTextVNode as f, toDisplayString as S, createElementVNode as x, renderSlot as y, createCommentVNode as C } from "vue";
2
- import { ScalarCodeBlock as X } from "@scalar/components";
3
- import { createHash as Z, ssrState as ee } from "@scalar/oas-utils/helpers";
4
- import { getRequestFromOperation as te } from "@scalar/oas-utils/spec-getters";
5
- import { asyncComputed as oe } from "@vueuse/core";
6
- import B from "../../components/ScreenReader.vue.js";
7
- import re from "./ExamplePicker.vue.js";
8
- import ae from "./TextSelect.vue.js";
1
+ import { defineComponent as Y, useId as D, computed as d, ref as z, watch as G, inject as Q, onServerPrefetch as W, useSSRContext as X, unref as r, openBlock as p, createBlock as g, withCtx as a, createVNode as l, createElementBlock as S, Fragment as O, createTextVNode as f, toDisplayString as K, createElementVNode as x, renderSlot as y, createCommentVNode as C } from "vue";
2
+ import { ScalarCodeBlock as Z } from "@scalar/components";
3
+ import { createHash as ee, ssrState as te } from "@scalar/oas-utils/helpers";
4
+ import { getRequestFromOperation as oe } from "@scalar/oas-utils/spec-getters";
5
+ import { asyncComputed as re } from "@vueuse/core";
6
+ import R from "../../components/ScreenReader.vue.js";
7
+ import ae from "./ExamplePicker.vue.js";
8
+ import le from "./TextSelect.vue.js";
9
9
  /* empty css */
10
- import { GLOBAL_SECURITY_SYMBOL as le } from "../../helpers/provideSymbols.js";
11
- import N from "../../components/Card/Card.vue.js";
12
- import se from "../../components/Card/CardHeader.vue.js";
13
- import T from "../../components/HttpMethod/HttpMethod.vue.js";
14
- import j from "../../components/Card/CardContent.vue.js";
15
- import { getSecretCredentialsFromAuthentication as ne, getRequestFromAuthentication as ie } from "../../legacy/helpers/getRequestFromAuthentication.js";
16
- import ue from "../../components/Card/CardFooter.vue.js";
17
- import { getExampleCode as me } from "../../helpers/getExampleCode.js";
10
+ import { GLOBAL_SECURITY_SYMBOL as se } from "../../helpers/provideSymbols.js";
11
+ import B from "../../components/Card/Card.vue.js";
12
+ import ne from "../../components/Card/CardHeader.vue.js";
13
+ import N from "../../components/HttpMethod/HttpMethod.vue.js";
14
+ import T from "../../components/Card/CardContent.vue.js";
15
+ import { getSecretCredentialsFromAuthentication as ie, getRequestFromAuthentication as ue } from "../../legacy/helpers/getRequestFromAuthentication.js";
16
+ import me from "../../components/Card/CardFooter.vue.js";
17
+ import { getExampleCode as pe } from "../../helpers/getExampleCode.js";
18
18
  import { useHttpClientStore as ce } from "../../stores/useHttpClientStore.js";
19
- import { useServerStore as pe } from "../../legacy/stores/useServerStore.js";
20
- import { useAuthenticationStore as de } from "../../legacy/stores/useAuthenticationStore.js";
21
- import { getHarRequest as fe } from "../../helpers/getHarRequest.js";
22
- import { getUrlFromServerState as ye } from "../../legacy/helpers/getUrlFromServerState.js";
23
- const ve = ["id"], he = ["id"], ge = {
19
+ import { useServerStore as de } from "../../legacy/stores/useServerStore.js";
20
+ import { useExampleStore as fe } from "../../legacy/stores/useExampleStore.js";
21
+ import { useAuthenticationStore as ye } from "../../legacy/stores/useAuthenticationStore.js";
22
+ import { getHarRequest as ve } from "../../helpers/getHarRequest.js";
23
+ import { getUrlFromServerState as he } from "../../legacy/helpers/getUrlFromServerState.js";
24
+ const ge = ["id"], Se = ["id"], Ke = {
24
25
  key: 0,
25
26
  class: "request-card-footer-addon"
26
- }, Ke = { class: "request-header" }, Le = /* @__PURE__ */ Y({
27
+ }, xe = { class: "request-header" }, Ye = /* @__PURE__ */ Y({
27
28
  __name: "ExampleRequest",
28
29
  props: {
29
30
  operation: {},
30
31
  fallback: { type: Boolean }
31
32
  },
32
- setup(F) {
33
- const i = F, k = `components-Content-Operation-Example-Request${Z(
33
+ setup(j) {
34
+ const i = j, k = `components-Content-Operation-Example-Request${ee(
34
35
  i.operation.path + i.operation.httpVerb + i.operation.operationId
35
- )}`, E = O(), {
36
+ )}`, { selectedExampleKey: E, operationId: F } = fe(), {
36
37
  httpClient: u,
37
38
  setHttpClient: w,
38
39
  availableTargets: b,
39
- httpTargetTitle: U,
40
- httpClientTitle: A
41
- } = ce(), { server: J } = pe(), { authentication: q } = de(), v = D(), m = d(() => {
40
+ httpTargetTitle: I,
41
+ httpClientTitle: U
42
+ } = ce(), { server: A } = de(), { authentication: q } = ye(), v = D(), m = d(() => {
42
43
  var t;
43
44
  const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
44
45
  for (const o of e)
45
46
  if ((t = i.operation.information) != null && t[o])
46
47
  return [...i.operation.information[o]];
47
48
  return [];
48
- }), s = O(
49
+ }), s = z(
49
50
  // Default to first custom example
50
51
  m.value.length ? {
51
52
  targetKey: "customExamples",
@@ -58,7 +59,7 @@ const ve = ["id"], he = ["id"], ge = {
58
59
  }
59
60
  )
60
61
  );
61
- z(u, () => {
62
+ G(u, () => {
62
63
  s.value = {
63
64
  targetKey: u.targetKey,
64
65
  clientKey: u.clientKey
@@ -71,16 +72,16 @@ const ve = ["id"], he = ["id"], ge = {
71
72
  ((n = (o = (t = (e = i.operation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : n.examples) ?? {}
72
73
  ).length > 1;
73
74
  }
74
- ), h = G(le);
75
+ ), h = Q(se);
75
76
  async function V() {
76
- var n, p;
77
+ var n, c;
77
78
  if (s.value.targetKey === "customExamples")
78
79
  return ((n = m.value[s.value.clientKey]) == null ? void 0 : n.source) ?? "";
79
- const e = fe(
80
+ const e = ve(
80
81
  {
81
- url: ye(J).modifiedUrl
82
+ url: he(A).modifiedUrl
82
83
  },
83
- te(
84
+ oe(
84
85
  i.operation,
85
86
  {
86
87
  replaceVariables: !0
@@ -88,25 +89,25 @@ const ve = ["id"], he = ["id"], ge = {
88
89
  E.value,
89
90
  !0
90
91
  ),
91
- ie(
92
+ ue(
92
93
  q,
93
- ((p = i.operation.information) == null ? void 0 : p.security) ?? (h == null ? void 0 : h())
94
+ ((c = i.operation.information) == null ? void 0 : c.security) ?? (h == null ? void 0 : h())
94
95
  )
95
96
  ), t = u.clientKey, o = u.targetKey;
96
- return await me(e, o, t) ?? "";
97
+ return await pe(e, o, t) ?? "";
97
98
  }
98
- const $ = oe(async () => {
99
+ const $ = re(async () => {
99
100
  try {
100
101
  return await V();
101
102
  } catch (e) {
102
103
  return console.error("[generateSnippet]", e), "";
103
104
  }
104
- }, ee[k] ?? "");
105
- Q(async () => {
106
- const e = W();
105
+ }, te[k] ?? "");
106
+ W(async () => {
107
+ const e = X();
107
108
  e.payload.data[k] = await V();
108
109
  });
109
- const I = d(() => {
110
+ const J = d(() => {
110
111
  var t, o;
111
112
  const e = (
112
113
  // Specified language
@@ -144,14 +145,14 @@ const ve = ["id"], he = ["id"], ge = {
144
145
  const t = JSON.parse(e);
145
146
  t.targetKey === "customExamples" ? s.value = t : w(t);
146
147
  }
147
- return (e, t) => r(b).length || m.value.length ? (c(), g(r(N), {
148
+ return (e, t) => r(b).length || m.value.length ? (p(), g(r(B), {
148
149
  key: 0,
149
150
  class: "dark-mode"
150
151
  }, {
151
152
  default: a(() => [
152
- l(r(se), { muted: "" }, {
153
+ l(r(ne), { muted: "" }, {
153
154
  actions: a(() => [
154
- l(ae, {
155
+ l(le, {
155
156
  class: "request-client-picker",
156
157
  controls: `${r(v)}-example`,
157
158
  modelValue: JSON.stringify(s.value),
@@ -159,22 +160,22 @@ const ve = ["id"], he = ["id"], ge = {
159
160
  "onUpdate:modelValue": P
160
161
  }, {
161
162
  default: a(() => [
162
- s.value.targetKey === "customExamples" ? (c(), K(R, { key: 0 }, [
163
- l(B, null, {
163
+ s.value.targetKey === "customExamples" ? (p(), S(O, { key: 0 }, [
164
+ l(R, null, {
164
165
  default: a(() => t[1] || (t[1] = [
165
166
  f("Selected Example:")
166
167
  ])),
167
168
  _: 1
168
169
  }),
169
- f(" " + S(m.value[s.value.clientKey].label ?? "Example"), 1)
170
- ], 64)) : (c(), K(R, { key: 1 }, [
171
- l(B, null, {
170
+ f(" " + K(m.value[s.value.clientKey].label ?? "Example"), 1)
171
+ ], 64)) : (p(), S(O, { key: 1 }, [
172
+ l(R, null, {
172
173
  default: a(() => t[2] || (t[2] = [
173
174
  f("Selected HTTP client:")
174
175
  ])),
175
176
  _: 1
176
177
  }),
177
- f(" " + S(r(U)) + " " + S(r(A)), 1)
178
+ f(" " + K(r(I)) + " " + K(r(U)), 1)
178
179
  ], 64))
179
180
  ]),
180
181
  _: 1
@@ -185,17 +186,17 @@ const ve = ["id"], he = ["id"], ge = {
185
186
  id: `${r(v)}-header`,
186
187
  class: "request-header"
187
188
  }, [
188
- l(r(T), {
189
+ l(r(N), {
189
190
  as: "span",
190
191
  class: "request-method",
191
192
  method: e.operation.httpVerb
192
193
  }, null, 8, ["method"]),
193
194
  y(e.$slots, "header", {}, void 0, !0)
194
- ], 8, ve)
195
+ ], 8, ge)
195
196
  ]),
196
197
  _: 3
197
198
  }),
198
- l(r(j), {
199
+ l(r(T), {
199
200
  borderless: "",
200
201
  class: "request-editor-section custom-scroll",
201
202
  frameless: ""
@@ -205,30 +206,30 @@ const ve = ["id"], he = ["id"], ge = {
205
206
  id: `${r(v)}-example`,
206
207
  class: "code-snippet"
207
208
  }, [
208
- l(r(X), {
209
+ l(r(Z), {
209
210
  class: "bg-b-2",
210
211
  content: r($),
211
- hideCredentials: r(ne)(r(q)),
212
- lang: I.value,
212
+ hideCredentials: r(ie)(r(q)),
213
+ lang: J.value,
213
214
  lineNumbers: ""
214
215
  }, null, 8, ["content", "hideCredentials", "lang"])
215
- ], 8, he)
216
+ ], 8, Se)
216
217
  ]),
217
218
  _: 1
218
219
  }),
219
- _.value || e.$slots.footer ? (c(), g(r(ue), {
220
+ _.value || e.$slots.footer ? (p(), g(r(me), {
220
221
  key: 0,
221
222
  class: "request-card-footer",
222
223
  contrast: ""
223
224
  }, {
224
225
  default: a(() => {
225
- var o, n, p, H;
226
+ var o, n, c, H;
226
227
  return [
227
- _.value ? (c(), K("div", ge, [
228
- l(re, {
228
+ _.value ? (p(), S("div", Ke, [
229
+ l(ae, {
229
230
  class: "request-example-selector",
230
- examples: ((H = (p = (n = (o = e.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : n.content) == null ? void 0 : p["application/json"]) == null ? void 0 : H.examples) ?? [],
231
- "onUpdate:modelValue": t[0] || (t[0] = (M) => E.value = M)
231
+ examples: ((H = (c = (n = (o = e.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : n.content) == null ? void 0 : c["application/json"]) == null ? void 0 : H.examples) ?? [],
232
+ "onUpdate:modelValue": t[0] || (t[0] = (M) => (E.value = M, F.value = e.operation.operationId))
232
233
  }, null, 8, ["examples"])
233
234
  ])) : C("", !0),
234
235
  y(e.$slots, "footer", {}, void 0, !0)
@@ -238,15 +239,15 @@ const ve = ["id"], he = ["id"], ge = {
238
239
  })) : C("", !0)
239
240
  ]),
240
241
  _: 3
241
- })) : e.fallback ? (c(), g(r(N), {
242
+ })) : e.fallback ? (p(), g(r(B), {
242
243
  key: 1,
243
244
  class: "dark-mode"
244
245
  }, {
245
246
  default: a(() => [
246
- l(r(j), { class: "request-card-simple" }, {
247
+ l(r(T), { class: "request-card-simple" }, {
247
248
  default: a(() => [
248
- x("div", Ke, [
249
- l(r(T), {
249
+ x("div", xe, [
250
+ l(r(N), {
250
251
  as: "span",
251
252
  class: "request-method",
252
253
  method: e.operation.httpVerb
@@ -263,5 +264,5 @@ const ve = ["id"], he = ["id"], ge = {
263
264
  }
264
265
  });
265
266
  export {
266
- Le as default
267
+ Ye as default
267
268
  };