@scalar/api-reference 1.32.5 → 1.32.7

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 (94) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/browser/standalone.js +9924 -9851
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReference.vue.js +8 -8
  6. package/dist/components/Badge/Badge.vue.js +1 -1
  7. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  8. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +28 -26
  10. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  12. package/dist/components/Content/Schema/Schema.vue2.js +97 -156
  13. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts +7 -0
  14. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -0
  15. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +7 -0
  16. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +25 -0
  17. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
  19. package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +73 -90
  20. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +21 -0
  21. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -0
  22. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +92 -0
  23. package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +4 -0
  24. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -2
  25. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  26. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  27. package/dist/components/Content/Schema/SchemaProperty.vue2.js +54 -55
  28. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +2 -2
  29. package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +1 -1
  30. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +0 -2
  31. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  32. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  33. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +81 -97
  34. package/dist/components/Content/Schema/helpers/{formatExample.d.ts → format-example.d.ts} +1 -1
  35. package/dist/components/Content/Schema/helpers/format-example.d.ts.map +1 -0
  36. package/dist/components/Content/Schema/helpers/is-type-object.d.ts +3 -0
  37. package/dist/components/Content/Schema/helpers/is-type-object.d.ts.map +1 -0
  38. package/dist/components/Content/Schema/helpers/is-type-object.js +17 -0
  39. package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.d.ts → optimize-value-for-display.d.ts} +1 -1
  40. package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -0
  41. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  42. package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
  43. package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
  44. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  45. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  46. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  47. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +4 -2
  48. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  49. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  50. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +8 -8
  51. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +4 -2
  52. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  53. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  54. package/dist/features/Operation/layouts/ModernLayout.vue2.js +30 -30
  55. package/dist/features/api-client-modal/useApiClient.d.ts +84 -4
  56. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  57. package/dist/features/download-link/DownloadLink.vue.d.ts.map +1 -1
  58. package/dist/features/download-link/DownloadLink.vue.js +1 -1
  59. package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -1
  60. package/dist/features/example-request/ExampleRequest.vue.js +1 -1
  61. package/dist/features/example-request/ExampleRequest.vue2.js +126 -124
  62. package/dist/features/example-responses/ExampleResponse.vue.js +2 -2
  63. package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
  64. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
  65. package/dist/features/sidebar/components/SidebarElement.vue.js +2 -2
  66. package/dist/features/sidebar/components/SidebarElement.vue2.js +16 -15
  67. package/dist/helpers/convert-security-scheme.d.ts +9 -0
  68. package/dist/helpers/convert-security-scheme.d.ts.map +1 -0
  69. package/dist/index.js +1 -1
  70. package/dist/libs/openapi.d.ts +0 -13
  71. package/dist/libs/openapi.d.ts.map +1 -1
  72. package/dist/libs/openapi.js +49 -63
  73. package/dist/stores/useHttpClientStore.js +20 -20
  74. package/dist/style.css +1 -1
  75. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  76. package/dist/v2/ApiReferenceWorkspace.vue.js +84 -75
  77. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +19 -0
  78. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +1 -0
  79. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +21 -72
  80. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
  81. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +4 -2
  82. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -1
  83. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +5 -0
  84. package/dist/v2/blocks/scalar-request-example-block/index.d.ts +1 -0
  85. package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +1 -1
  86. package/dist/v2/events/definitions.d.ts +13 -4
  87. package/dist/v2/events/definitions.d.ts.map +1 -1
  88. package/dist/v2/hooks/useStore.d.ts +9 -0
  89. package/dist/v2/hooks/useStore.d.ts.map +1 -0
  90. package/package.json +13 -12
  91. package/dist/components/Content/Schema/helpers/formatExample.d.ts.map +0 -1
  92. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +0 -1
  93. /package/dist/components/Content/Schema/helpers/{formatExample.js → format-example.js} +0 -0
  94. /package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.js → optimize-value-for-display.js} +0 -0
@@ -1,28 +1,28 @@
1
- import { defineComponent as pe, useId as fe, ref as j, inject as Q, computed as m, watch as Y, onMounted as ye, createBlock as w, createCommentVNode as J, unref as r, openBlock as g, withCtx as s, createVNode as n, createElementVNode as U, renderSlot as $, createTextVNode as b, createElementBlock as D, Fragment as Z, toDisplayString as H } from "vue";
2
- import { useWorkspace as ve } from "@scalar/api-client/store";
3
- import { getHarRequest as ge, getSnippet as xe } from "@scalar/api-client/views/Components/CodeSnippet";
4
- import { filterSecurityRequirements as he } from "@scalar/api-client/views/Request/RequestSection";
5
- import { ScalarCodeBlock as qe } from "@scalar/components";
6
- import { freezeElement as Ee } from "@scalar/helpers/dom/freeze-element";
7
- import { requestSchema as Ke, createExampleFromRequest as be } from "@scalar/oas-utils/entities/spec";
8
- import { isDereferenced as Se } from "@scalar/openapi-types/helpers";
9
- import I from "../../components/ScreenReader.vue.js";
10
- import { useConfig as ke } from "../../hooks/useConfig.js";
11
- import { EXAMPLE_CONTEXT as Ce, DISCRIMINATOR_CONTEXT as Oe } from "../../hooks/useDiscriminator.js";
12
- import { useHttpClientStore as Ne } from "../../stores/useHttpClientStore.js";
13
- import $e from "./ExamplePicker.vue.js";
14
- import Te from "./TextSelect.vue.js";
1
+ import { defineComponent as ye, useId as ve, ref as w, inject as Y, computed as c, watch as Z, onMounted as ge, createBlock as J, createCommentVNode as U, unref as r, openBlock as g, withCtx as s, createVNode as n, createElementVNode as D, renderSlot as T, createTextVNode as b, createElementBlock as H, Fragment as _, toDisplayString as I } from "vue";
2
+ import { useWorkspace as xe } from "@scalar/api-client/store";
3
+ import { getHarRequest as he, getSnippet as qe } from "@scalar/api-client/views/Components/CodeSnippet";
4
+ import { filterSecurityRequirements as Ee } from "@scalar/api-client/views/Request/RequestSection";
5
+ import { ScalarCodeBlock as Ke } from "@scalar/components";
6
+ import { freezeElement as be } from "@scalar/helpers/dom/freeze-element";
7
+ import { requestSchema as Se, createExampleFromRequest as ke } from "@scalar/oas-utils/entities/spec";
8
+ import { isDereferenced as Ce } from "@scalar/openapi-types/helpers";
9
+ import M from "../../components/ScreenReader.vue.js";
10
+ import { useConfig as Oe } from "../../hooks/useConfig.js";
11
+ import { EXAMPLE_CONTEXT as Ne, DISCRIMINATOR_CONTEXT as $e } from "../../hooks/useDiscriminator.js";
12
+ import { useHttpClientStore as Te } from "../../stores/useHttpClientStore.js";
13
+ import Ve from "./ExamplePicker.vue.js";
14
+ import Re from "./TextSelect.vue.js";
15
15
  /* empty css */
16
- import _ from "../../components/Card/Card.vue.js";
17
- import Ve from "../../components/Card/CardHeader.vue.js";
18
- import ee from "../../components/HttpMethod/HttpMethod.vue.js";
19
- import te from "../../components/Card/CardContent.vue.js";
20
- import Re from "../../components/Card/CardFooter.vue.js";
21
- import { useExampleStore as Be } from "../../legacy/stores/useExampleStore.js";
22
- const je = ["id"], we = ["id"], Je = {
16
+ import ee from "../../components/Card/Card.vue.js";
17
+ import Be from "../../components/Card/CardHeader.vue.js";
18
+ import te from "../../components/HttpMethod/HttpMethod.vue.js";
19
+ import ae from "../../components/Card/CardContent.vue.js";
20
+ import je from "../../components/Card/CardFooter.vue.js";
21
+ import { useExampleStore as we } from "../../legacy/stores/useExampleStore.js";
22
+ const Je = ["id"], Ue = ["id"], De = {
23
23
  key: 0,
24
24
  class: "request-card-footer-addon"
25
- }, Ue = { class: "request-header" }, ot = /* @__PURE__ */ pe({
25
+ }, He = { class: "request-header" }, nt = /* @__PURE__ */ ye({
26
26
  __name: "ExampleRequest",
27
27
  props: {
28
28
  server: {},
@@ -34,28 +34,28 @@ const je = ["id"], we = ["id"], Je = {
34
34
  schemas: {}
35
35
  },
36
36
  setup(l) {
37
- const { selectedExampleKey: M, operationId: ae } = Be(), { requestExamples: S, securitySchemes: A, requestExampleMutators: T } = ve(), le = ke(), {
37
+ const { selectedExampleKey: A, operationId: le } = we(), { requestExamples: S, securitySchemes: F, requestExampleMutators: V } = xe(), re = Oe(), {
38
38
  httpClient: u,
39
- setHttpClient: re,
40
- availableTargets: F,
41
- httpTargetTitle: oe,
42
- httpClientTitle: se
43
- } = Ne(), k = fe(), x = j(!1), C = Q(Ce), f = Q(Oe), V = m(() => {
39
+ setHttpClient: oe,
40
+ availableTargets: P,
41
+ httpTargetTitle: se,
42
+ httpClientTitle: ne
43
+ } = Te(), k = ve(), x = w(!1), C = Y(Ne), f = Y($e), R = c(() => {
44
44
  var e;
45
45
  return (e = f == null ? void 0 : f.value) == null ? void 0 : e.selectedType;
46
- }), P = m(
46
+ }), X = c(
47
47
  () => {
48
48
  var e;
49
49
  return ((e = f == null ? void 0 : f.value) == null ? void 0 : e.hasDiscriminator) || !1;
50
50
  }
51
- ), d = m(() => {
51
+ ), d = c(() => {
52
52
  var t;
53
53
  const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
54
54
  for (const a of e)
55
55
  if ((t = l.operation) != null && t[a])
56
56
  return [...l.operation[a]];
57
57
  return [];
58
- }), o = j(
58
+ }), o = w(
59
59
  // Default to first custom example
60
60
  d.value.length ? {
61
61
  targetKey: "customExamples",
@@ -68,20 +68,20 @@ const je = ["id"], we = ["id"], Je = {
68
68
  }
69
69
  )
70
70
  );
71
- Y(u, () => {
71
+ Z(u, () => {
72
72
  o.value = {
73
73
  targetKey: u.targetKey,
74
74
  clientKey: u.clientKey
75
75
  };
76
76
  });
77
- const X = m(() => {
77
+ const z = c(() => {
78
78
  const e = O.value;
79
79
  return Object.keys(e).length > 1;
80
- }), ne = () => {
81
- var q, E, c;
80
+ }), ue = () => {
81
+ var q, E, K;
82
82
  if (o.value.targetKey === "customExamples")
83
83
  return ((q = d.value[o.value.clientKey]) == null ? void 0 : q.source) ?? "";
84
- const e = u.clientKey, t = u.targetKey, a = l.request || Ke.parse({
84
+ const e = u.clientKey, t = u.targetKey, a = l.request || Se.parse({
85
85
  uid: l.operation.operationId || "temp-request",
86
86
  method: l.method,
87
87
  path: l.operation.path,
@@ -94,35 +94,35 @@ const je = ["id"], we = ["id"], Je = {
94
94
  servers: [],
95
95
  summary: l.operation.summary || "Example Request"
96
96
  });
97
- let i = S[((c = (E = l.request) == null ? void 0 : E.examples) == null ? void 0 : c[0]) ?? ""];
97
+ let i = S[((K = (E = l.request) == null ? void 0 : E.examples) == null ? void 0 : K[0]) ?? ""];
98
98
  if (!i) {
99
- const B = O.value, K = Object.keys(B)[0];
100
- i = be(a, K);
99
+ const $ = O.value, m = Object.keys($)[0];
100
+ i = ke(a, m);
101
101
  }
102
- const p = he(
102
+ const p = Ee(
103
103
  l.operation.security || l.collection.security,
104
104
  l.collection.selectedSecuritySchemeUids,
105
- A
106
- ), y = ge({
105
+ F
106
+ ), y = he({
107
107
  operation: a,
108
108
  example: i,
109
109
  server: l.server,
110
110
  securitySchemes: p
111
- }), [h, N] = xe(t, e, y);
111
+ }), [h, N] = qe(t, e, y);
112
112
  return h ? h.message ?? "" : N;
113
- }, z = m(() => {
113
+ }, L = c(() => {
114
114
  try {
115
- return ne();
115
+ return ue();
116
116
  } catch (e) {
117
117
  return console.error("[generateSnippet]", e), "";
118
118
  }
119
- }), O = m(() => {
119
+ }), O = c(() => {
120
120
  var a;
121
- if (!Se(l.operation.requestBody))
121
+ if (!Ce(l.operation.requestBody))
122
122
  return {};
123
123
  const e = ((a = l.operation.requestBody) == null ? void 0 : a.content) ?? {}, t = Object.values(e)[0];
124
124
  return (t == null ? void 0 : t.examples) ?? {};
125
- }), ue = m(() => {
125
+ }), ie = c(() => {
126
126
  var t, a;
127
127
  const e = (
128
128
  // Specified language
@@ -131,15 +131,15 @@ const je = ["id"], we = ["id"], Je = {
131
131
  u.targetKey
132
132
  )
133
133
  );
134
- return e === "shell" && z.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
135
- }), ie = m(
136
- () => Object.values(A).flatMap((e) => e.type === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
134
+ return e === "shell" && L.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
135
+ }), ce = c(
136
+ () => Object.values(F).flatMap((e) => e.type === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
137
137
  e.token,
138
138
  e.password,
139
139
  btoa(`${e.username}:${e.password}`)
140
140
  ] : e.type === "oauth2" ? Object.values(e.flows).map((t) => t.token) : [])
141
- ), ce = m(() => {
142
- const e = F.value.map((t) => ({
141
+ ), me = c(() => {
142
+ const e = P.value.map((t) => ({
143
143
  value: t.key,
144
144
  label: t.title,
145
145
  options: t.clients.map((a) => ({
@@ -161,24 +161,26 @@ const je = ["id"], we = ["id"], Je = {
161
161
  label: t.label ?? t.lang ?? `Example #${a + 1}`
162
162
  }))
163
163
  }), e;
164
- }), R = j(null);
165
- function me(e) {
164
+ }), B = w(null);
165
+ function de(e) {
166
166
  const t = JSON.parse(e);
167
- if (R.value) {
168
- const a = Ee(R.value.$el);
167
+ if (B.value) {
168
+ const a = be(B.value.$el);
169
169
  setTimeout(() => {
170
170
  a();
171
171
  }, 300);
172
172
  }
173
- t.targetKey === "customExamples" || o.value.targetKey === "customExamples" && t.targetKey === u.targetKey && t.clientKey === u.clientKey ? o.value = t : re(t);
173
+ t.targetKey === "customExamples" || o.value.targetKey === "customExamples" && t.targetKey === u.targetKey && t.clientKey === u.clientKey ? o.value = t : oe(t);
174
174
  }
175
- function de(e) {
175
+ function pe(e) {
176
176
  var i, p;
177
- M.value = e, ae.value = l.operation.operationId;
177
+ if (!e)
178
+ return;
179
+ A.value = e, le.value = l.operation.operationId;
178
180
  const t = S[((p = (i = l.request) == null ? void 0 : i.examples) == null ? void 0 : p[0]) ?? ""], a = O.value[e];
179
181
  if (t && (a != null && a.value))
180
182
  try {
181
- T.edit(
183
+ V.edit(
182
184
  t.uid,
183
185
  "body.raw.value",
184
186
  JSON.stringify(a.value, null, 2)
@@ -187,173 +189,173 @@ const je = ["id"], we = ["id"], Je = {
187
189
  console.error("[handleExampleUpdate]", y);
188
190
  }
189
191
  }
190
- ye(() => {
191
- P.value && V.value && !x.value && L(V.value);
192
+ ge(() => {
193
+ X.value && R.value && !x.value && W(R.value);
192
194
  });
193
- const L = (e) => {
194
- var t, a, i, p, y, h, N, q, E;
195
+ const W = (e) => {
196
+ var t, a, i, p, y, h, N, q, E, K, $;
195
197
  if (!x.value)
196
198
  try {
197
199
  x.value = !0;
198
- const c = S[l.operation.examples[0]];
199
- if (c && (C != null && C.generateExampleValue)) {
200
- const B = (a = (t = c.body) == null ? void 0 : t.raw) != null && a.value ? JSON.parse(c.body.raw.value) : void 0, K = C.generateExampleValue(
201
- Array.isArray(B)
200
+ const m = S[((a = (t = l.request) == null ? void 0 : t.examples) == null ? void 0 : a[0]) ?? ""];
201
+ if (m && (C != null && C.generateExampleValue)) {
202
+ const fe = (p = (i = m.body) == null ? void 0 : i.raw) != null && p.value ? JSON.parse(m.body.raw.value) : void 0, j = C.generateExampleValue(
203
+ Array.isArray(fe)
202
204
  );
203
- if (T.edit(
204
- c.uid,
205
+ if (V.edit(
206
+ m.uid,
205
207
  "body.raw.value",
206
- JSON.stringify(K, null, 2)
207
- ), (p = (i = l.request) == null ? void 0 : i.examples) != null && p[0]) {
208
- const v = S[(h = (y = l.request) == null ? void 0 : y.examples) == null ? void 0 : h[0]];
209
- v && T.edit(
208
+ JSON.stringify(j, null, 2)
209
+ ), (h = (y = l.request) == null ? void 0 : y.examples) != null && h[0]) {
210
+ const v = S[(q = (N = l.request) == null ? void 0 : N.examples) == null ? void 0 : q[0]];
211
+ v && V.edit(
210
212
  v.uid,
211
213
  "body.raw.value",
212
- JSON.stringify(K, null, 2)
214
+ JSON.stringify(j, null, 2)
213
215
  );
214
216
  }
215
- if ((E = (q = (N = l.operation.requestBody) == null ? void 0 : N.content) == null ? void 0 : q["application/json"]) != null && E.examples) {
217
+ if (($ = (K = (E = l.operation.requestBody) == null ? void 0 : E.content) == null ? void 0 : K["application/json"]) != null && $.examples) {
216
218
  const v = l.operation.requestBody.content["application/json"].examples;
217
- Object.keys(v).forEach((W) => {
218
- var G;
219
- (G = v[W]) != null && G.value && (v[W].value = K);
219
+ Object.keys(v).forEach((G) => {
220
+ var Q;
221
+ (Q = v[G]) != null && Q.value && (v[G].value = j);
220
222
  });
221
223
  }
222
224
  }
223
- } catch (c) {
224
- console.error("[handleDiscriminatorChange]", c);
225
+ } catch (m) {
226
+ console.error("[handleDiscriminatorChange]", m);
225
227
  } finally {
226
228
  x.value = !1;
227
229
  }
228
230
  };
229
- return Y(V, (e) => {
230
- e && P.value && !x.value && L();
231
- }), (e, t) => r(F).length || d.value.length ? (g(), w(r(_), {
231
+ return Z(R, (e) => {
232
+ e && X.value && !x.value && W();
233
+ }), (e, t) => r(P).length || d.value.length ? (g(), J(r(ee), {
232
234
  key: 0,
233
235
  "aria-labelledby": `${r(k)}-header`,
234
236
  class: "dark-mode",
235
237
  ref_key: "elem",
236
- ref: R,
238
+ ref: B,
237
239
  role: "region"
238
240
  }, {
239
241
  default: s(() => [
240
- n(r(Ve), { muted: "" }, {
242
+ n(r(Be), { muted: "" }, {
241
243
  actions: s(() => [
242
- n(Te, {
244
+ n(Re, {
243
245
  class: "request-client-picker",
244
246
  controls: `${r(k)}-example`,
245
247
  modelValue: JSON.stringify(o.value),
246
- options: ce.value,
247
- "onUpdate:modelValue": me
248
+ options: me.value,
249
+ "onUpdate:modelValue": de
248
250
  }, {
249
251
  default: s(() => [
250
- o.value.targetKey === "customExamples" ? (g(), D(Z, { key: 0 }, [
251
- n(I, null, {
252
+ o.value.targetKey === "customExamples" ? (g(), H(_, { key: 0 }, [
253
+ n(M, null, {
252
254
  default: s(() => t[1] || (t[1] = [
253
255
  b("Selected Example:")
254
256
  ])),
255
257
  _: 1
256
258
  }),
257
- b(" " + H(d.value[o.value.clientKey].label ?? "Example"), 1)
258
- ], 64)) : (g(), D(Z, { key: 1 }, [
259
- n(I, null, {
259
+ b(" " + I(d.value[o.value.clientKey].label ?? "Example"), 1)
260
+ ], 64)) : (g(), H(_, { key: 1 }, [
261
+ n(M, null, {
260
262
  default: s(() => t[2] || (t[2] = [
261
263
  b("Selected HTTP client:")
262
264
  ])),
263
265
  _: 1
264
266
  }),
265
- b(" " + H(r(oe)) + " " + H(r(se)), 1)
267
+ b(" " + I(r(se)) + " " + I(r(ne)), 1)
266
268
  ], 64))
267
269
  ]),
268
270
  _: 1
269
271
  }, 8, ["controls", "modelValue", "options"])
270
272
  ]),
271
273
  default: s(() => [
272
- U("div", {
274
+ D("div", {
273
275
  id: `${r(k)}-header`,
274
276
  class: "request-header"
275
277
  }, [
276
- n(I, null, {
278
+ n(M, null, {
277
279
  default: s(() => t[0] || (t[0] = [
278
280
  b("Request Example for")
279
281
  ])),
280
282
  _: 1
281
283
  }),
282
- n(r(ee), {
284
+ n(r(te), {
283
285
  as: "span",
284
286
  class: "request-method",
285
287
  method: e.method
286
288
  }, null, 8, ["method"]),
287
- $(e.$slots, "header", {}, void 0, !0)
288
- ], 8, je)
289
+ T(e.$slots, "header", {}, void 0, !0)
290
+ ], 8, Je)
289
291
  ]),
290
292
  _: 3
291
293
  }),
292
- n(r(te), {
294
+ n(r(ae), {
293
295
  borderless: "",
294
296
  class: "request-editor-section custom-scroll",
295
297
  frameless: ""
296
298
  }, {
297
299
  default: s(() => [
298
- U("div", {
300
+ D("div", {
299
301
  id: `${r(k)}-example`,
300
302
  class: "code-snippet"
301
303
  }, [
302
- n(r(qe), {
304
+ n(r(Ke), {
303
305
  class: "bg-b-2 -outline-offset-2",
304
- content: z.value,
305
- hideCredentials: ie.value,
306
- lang: ue.value,
306
+ content: L.value,
307
+ hideCredentials: ce.value,
308
+ lang: ie.value,
307
309
  lineNumbers: ""
308
310
  }, null, 8, ["content", "hideCredentials", "lang"])
309
- ], 8, we)
311
+ ], 8, Ue)
310
312
  ]),
311
313
  _: 1
312
314
  }),
313
- (X.value || !r(le).hideTestRequestButton) && e.$slots.footer ? (g(), w(r(Re), {
315
+ (z.value || !r(re).hideTestRequestButton) && e.$slots.footer ? (g(), J(r(je), {
314
316
  key: 0,
315
317
  class: "request-card-footer",
316
318
  contrast: ""
317
319
  }, {
318
320
  default: s(() => [
319
- X.value ? (g(), D("div", Je, [
320
- n($e, {
321
+ z.value ? (g(), H("div", De, [
322
+ n(Ve, {
321
323
  class: "request-example-selector",
322
324
  examples: O.value,
323
- modelValue: r(M),
324
- "onUpdate:modelValue": de
325
+ modelValue: r(A),
326
+ "onUpdate:modelValue": pe
325
327
  }, null, 8, ["examples", "modelValue"])
326
- ])) : J("", !0),
327
- $(e.$slots, "footer", {}, void 0, !0)
328
+ ])) : U("", !0),
329
+ T(e.$slots, "footer", {}, void 0, !0)
328
330
  ]),
329
331
  _: 3
330
- })) : J("", !0)
332
+ })) : U("", !0)
331
333
  ]),
332
334
  _: 3
333
- }, 8, ["aria-labelledby"])) : e.fallback ? (g(), w(r(_), {
335
+ }, 8, ["aria-labelledby"])) : e.fallback ? (g(), J(r(ee), {
334
336
  key: 1,
335
337
  class: "dark-mode"
336
338
  }, {
337
339
  default: s(() => [
338
- n(r(te), { class: "request-card-simple" }, {
340
+ n(r(ae), { class: "request-card-simple" }, {
339
341
  default: s(() => [
340
- U("div", Ue, [
341
- n(r(ee), {
342
+ D("div", He, [
343
+ n(r(te), {
342
344
  as: "span",
343
345
  class: "request-method",
344
346
  method: e.method
345
347
  }, null, 8, ["method"]),
346
- $(e.$slots, "header", {}, void 0, !0)
348
+ T(e.$slots, "header", {}, void 0, !0)
347
349
  ]),
348
- $(e.$slots, "footer", {}, void 0, !0)
350
+ T(e.$slots, "footer", {}, void 0, !0)
349
351
  ]),
350
352
  _: 3
351
353
  })
352
354
  ]),
353
355
  _: 3
354
- })) : J("", !0);
356
+ })) : U("", !0);
355
357
  }
356
358
  });
357
359
  export {
358
- ot as default
360
+ nt as default
359
361
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ExampleResponse.vue2.js";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ p(o, [["__scopeId", "data-v-083238b5"]]);
4
+ const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-157f3a0c"]]);
5
5
  export {
6
- r as default
6
+ m as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ExampleResponses.vue2.js";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-faf7cdd7"]]);
4
+ const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-9c53bbc5"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/components/SidebarElement.vue"],"names":[],"mappings":"AAoWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAShE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WAmLT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,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":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/components/SidebarElement.vue"],"names":[],"mappings":"AAgXA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WAwLT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,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 "./SidebarElement.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7295d65c"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fa7fb2b8"]]);
5
5
  export {
6
- a as default
6
+ f as default
7
7
  };
@@ -1,13 +1,12 @@
1
- import { defineComponent as $, createElementBlock as d, openBlock as n, createElementVNode as a, renderSlot as g, createCommentVNode as r, normalizeClass as A, unref as s, createTextVNode as p, withModifiers as O, createVNode as b, withCtx as v, toDisplayString as h, createBlock as T, normalizeStyle as E } from "vue";
1
+ import { defineComponent as $, createElementBlock as d, openBlock as n, createElementVNode as a, renderSlot as g, createCommentVNode as r, normalizeClass as A, unref as s, createTextVNode as m, withModifiers as O, createVNode as b, withCtx as v, toDisplayString as h, createBlock as T, normalizeStyle as E } from "vue";
2
2
  import { ScalarSidebarGroupToggle as N } from "@scalar/components";
3
3
  import { scrollToId as V } from "@scalar/helpers/dom/scroll-to-id";
4
4
  import { getHttpMethodInfo as H } from "@scalar/helpers/http/http-info";
5
5
  import { sleep as k } from "@scalar/helpers/testing/sleep";
6
6
  import { ScalarIconWebhooksLogo as I } from "@scalar/icons";
7
- import { combineUrlAndPath as R } from "@scalar/oas-utils/helpers";
8
- import { useConfig as U } from "../../../hooks/useConfig.js";
9
- import { useNavState as D } from "../../../hooks/useNavState.js";
10
- import { isOperationDeprecated as L } from "../../../libs/openapi.js";
7
+ import { isOperationDeprecated as R, combineUrlAndPath as U } from "@scalar/oas-utils/helpers";
8
+ import { useConfig as D } from "../../../hooks/useConfig.js";
9
+ import { useNavState as L } from "../../../hooks/useNavState.js";
11
10
  import M from "./SidebarHttpBadge.vue.js";
12
11
  const P = ["id"], z = {
13
12
  key: 0,
@@ -18,7 +17,7 @@ const P = ["id"], z = {
18
17
  }, q = {
19
18
  key: 1,
20
19
  class: "action-menu"
21
- }, ie = /* @__PURE__ */ $({
20
+ }, oe = /* @__PURE__ */ $({
22
21
  __name: "SidebarElement",
23
22
  props: {
24
23
  id: {},
@@ -29,11 +28,11 @@ const P = ["id"], z = {
29
28
  },
30
29
  emits: ["toggleOpen"],
31
30
  setup(C, { emit: y }) {
32
- const o = C, m = y, { getFullHash: u, isIntersectionEnabled: l, replaceUrlState: w } = D(), i = U(), c = async () => {
33
- l.value = !1, o.hasChildren && m("toggleOpen"), await k(100), l.value = !0;
31
+ const o = C, p = y, { getFullHash: u, isIntersectionEnabled: l, replaceUrlState: w } = L(), i = D(), c = async () => {
32
+ l.value = !1, o.hasChildren && p("toggleOpen"), await k(100), l.value = !0;
34
33
  }, S = () => {
35
34
  if (i.value.pathRouting)
36
- return R(i.value.pathRouting.basePath, o.item.id);
35
+ return U(i.value.pathRouting.basePath, o.item.id);
37
36
  if (typeof window < "u") {
38
37
  const e = new URL(window.location.href);
39
38
  return e.hash = u(o.item.id), `${e.pathname}${e.search}${e.hash}`;
@@ -41,7 +40,7 @@ const P = ["id"], z = {
41
40
  return `#${u(o.item.id)}`;
42
41
  }, B = async (e) => {
43
42
  var t, f;
44
- (f = (t = i.value).onSidebarClick) == null || f.call(t, o.item.id), i.value.pathRouting && (e.preventDefault(), o.hasChildren && m("toggleOpen"), m("toggleOpen"), l.value = !1, w(o.item.id), V(o.item.id), await k(100), l.value = !0);
43
+ (f = (t = i.value).onSidebarClick) == null || f.call(t, o.item.id), i.value.pathRouting && (e.preventDefault(), o.hasChildren && p("toggleOpen"), p("toggleOpen"), l.value = !1, w(o.item.id), V(o.item.id), await k(100), l.value = !0);
45
44
  };
46
45
  return (e, t) => (n(), d("li", {
47
46
  id: e.id,
@@ -51,7 +50,9 @@ const P = ["id"], z = {
51
50
  class: A(["sidebar-heading", {
52
51
  "sidebar-group-item__folder": e.hasChildren,
53
52
  active_page: e.isActive,
54
- deprecated: "operation" in e.item && s(L)(e.item.operation)
53
+ deprecated: "operation" in e.item && s(R)(
54
+ e.item.operation
55
+ )
55
56
  }]),
56
57
  onClick: c
57
58
  }, [
@@ -64,12 +65,12 @@ const P = ["id"], z = {
64
65
  }, [
65
66
  b(s(N), { open: e.open }, {
66
67
  label: v(() => [
67
- p(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
68
+ m(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
68
69
  ]),
69
70
  _: 1
70
71
  }, 8, ["open"])
71
72
  ], 8, j),
72
- t[0] || (t[0] = p("   "))
73
+ t[0] || (t[0] = m("   "))
73
74
  ])) : r("", !0),
74
75
  a("a", {
75
76
  class: "sidebar-heading-link",
@@ -79,7 +80,7 @@ const P = ["id"], z = {
79
80
  }, [
80
81
  a("p", G, h(e.item.title), 1),
81
82
  "method" in e.item && !e.hasChildren ? (n(), d("p", W, [
82
- t[1] || (t[1] = p("   ")),
83
+ t[1] || (t[1] = m("   ")),
83
84
  t[2] || (t[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
84
85
  b(M, {
85
86
  class: "min-w-9.75 justify-end text-right",
@@ -108,5 +109,5 @@ const P = ["id"], z = {
108
109
  }
109
110
  });
110
111
  export {
111
- ie as default
112
+ oe as default
112
113
  };
@@ -0,0 +1,9 @@
1
+ import type { SecurityScheme } from '@scalar/oas-utils/entities/spec';
2
+ import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
3
+ /**
4
+ * Convert the old security scheme to the new one with secret extensions
5
+ *
6
+ * Remove this once we are migrated to the workspace store
7
+ */
8
+ export declare const convertSecurityScheme: (scheme: SecurityScheme) => SecuritySchemeObject;
9
+ //# sourceMappingURL=convert-security-scheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-security-scheme.d.ts","sourceRoot":"","sources":["../../src/helpers/convert-security-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AAEvG;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,WAAY,cAAc,KAAG,oBAsC9D,CAAA"}