@scalar/api-reference 1.25.48 → 1.25.49

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 (64) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/browser/standalone.js +13698 -13755
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  6. package/dist/components/ApiReferenceLayout.vue2.js +136 -137
  7. package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
  9. package/dist/components/Content/Operation/TestRequestButton.vue2.js +18 -17
  10. package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts.map +1 -1
  11. package/dist/components/DarkModeToggle/DarkModeToggle.vue.js +1 -1
  12. package/dist/components/DarkModeToggle/DarkModeToggle.vue2.js +12 -11
  13. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  14. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  15. package/dist/components/Sidebar/Sidebar.vue2.js +146 -142
  16. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  17. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  18. package/dist/components/Sidebar/SidebarElement.vue2.js +37 -35
  19. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
  20. package/dist/{components → features/ApiClientModal}/ApiClientModal.vue.d.ts +3 -3
  21. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -0
  22. package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -0
  23. package/dist/features/ApiClientModal/index.d.ts +3 -0
  24. package/dist/features/ApiClientModal/index.d.ts.map +1 -0
  25. package/dist/features/ApiClientModal/useApiClient.d.ts +7734 -0
  26. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -0
  27. package/dist/features/ApiClientModal/useApiClient.js +23 -0
  28. package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -1
  29. package/dist/features/BaseUrl/ServerUrlSelect.vue.js +2 -2
  30. package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +10 -7
  31. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  32. package/dist/features/Search/SearchButton.vue.js +2 -2
  33. package/dist/features/Search/SearchButton.vue2.js +16 -20
  34. package/dist/helpers/index.d.ts +0 -1
  35. package/dist/helpers/index.d.ts.map +1 -1
  36. package/dist/hooks/useSidebar.d.ts.map +1 -1
  37. package/dist/hooks/useSidebar.js +148 -155
  38. package/dist/index.js +43 -45
  39. package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -1
  40. package/dist/legacy/components/SecurityScheme.vue.js +2 -2
  41. package/dist/legacy/components/SecurityScheme.vue2.js +111 -115
  42. package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -1
  43. package/dist/legacy/components/SecuritySchemeSelector.vue.js +1 -1
  44. package/dist/legacy/components/SecuritySchemeSelector.vue2.js +46 -36
  45. package/dist/legacy/helpers/index.d.ts +1 -1
  46. package/dist/legacy/stores/index.d.ts +1 -2
  47. package/dist/legacy/stores/index.d.ts.map +1 -1
  48. package/dist/legacy/stores/useOpenApiStore.js +4 -18
  49. package/dist/style.css +1 -1
  50. package/package.json +11 -11
  51. package/dist/components/ApiClientModal.vue.d.ts.map +0 -1
  52. package/dist/components/ApiClientModal.vue.js +0 -64
  53. package/dist/components/api-client-bus.d.ts +0 -22
  54. package/dist/components/api-client-bus.d.ts.map +0 -1
  55. package/dist/components/api-client-bus.js +0 -6
  56. package/dist/helpers/openClientFor.d.ts +0 -7
  57. package/dist/helpers/openClientFor.d.ts.map +0 -1
  58. package/dist/helpers/openClientFor.js +0 -19
  59. package/dist/legacy/helpers/createPlaceholderRequest.js +0 -14
  60. package/dist/legacy/stores/useApiClientStore.d.ts +0 -18
  61. package/dist/legacy/stores/useApiClientStore.d.ts.map +0 -1
  62. package/dist/legacy/stores/useApiClientStore.js +0 -32
  63. package/dist/legacy/stores/useRequestStore.js +0 -33
  64. /package/dist/{components → features/ApiClientModal}/ApiClientModal.vue2.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"SecurityScheme.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecurityScheme.vue"],"names":[],"mappings":"AAuhBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;YAkBxE,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB;YAC5B,MAAM;;YAHV,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB;YAC5B,MAAM;;AAqxBhB,wBAMG"}
1
+ {"version":3,"file":"SecurityScheme.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecurityScheme.vue"],"names":[],"mappings":"AA8gBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;YAkBxE,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB;YAC5B,MAAM;;YAHV,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB;YAC5B,MAAM;;AA4wBhB,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SecurityScheme.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-22bdc0a2"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b6e18839"]]);
5
5
  export {
6
- m as default
6
+ c as default
7
7
  };
@@ -1,7 +1,6 @@
1
- import { defineComponent as Q, computed as X, openBlock as l, createBlock as m, withModifiers as Y, withCtx as a, unref as u, createElementBlock as U, Fragment as K, createTextVNode as i, toDisplayString as Z, createCommentVNode as v, createVNode as d, createElementVNode as W } from "vue";
1
+ import { defineComponent as Q, computed as X, openBlock as n, createBlock as m, withModifiers as Y, withCtx as s, unref as l, createElementBlock as K, Fragment as F, createTextVNode as i, toDisplayString as Z, createCommentVNode as v, createVNode as d, createElementVNode as W } from "vue";
2
2
  import { concatenateUrlAndPath as x, redirectToProxy as _ } from "@scalar/oas-utils/helpers";
3
3
  import { useToasts as ee } from "@scalar/use-toasts";
4
- import { apiClientBus as F } from "../../components/api-client-bus.js";
5
4
  import te from "./CardForm.vue.js";
6
5
  import re from "./CardFormButton.vue.js";
7
6
  import P from "./CardFormGroup.vue.js";
@@ -11,28 +10,29 @@ import R from "./SecuritySchemeScopes.vue.js";
11
10
  import { useServerStore as oe } from "../stores/useServerStore.js";
12
11
  import { getUrlFromServerState as ae } from "../helpers/getUrlFromServerState.js";
13
12
  import { useAuthenticationStore as se } from "../stores/useAuthenticationStore.js";
14
- const ke = /* @__PURE__ */ Q({
13
+ import { useApiClient as ue } from "../../features/ApiClientModal/useApiClient.js";
14
+ const Se = /* @__PURE__ */ Q({
15
15
  __name: "SecurityScheme",
16
16
  props: {
17
17
  value: {},
18
18
  proxy: {}
19
19
  },
20
- setup(ue) {
21
- const { toast: L } = ee(), { server: N } = oe(), { authentication: r, setAuthentication: p } = se(), V = (t) => {
20
+ setup(le) {
21
+ const { toast: L } = ee(), { client: C } = ue(), { server: N } = oe(), { authentication: r, setAuthentication: p } = se(), V = (t) => {
22
+ var o;
22
23
  const e = t.target.value;
23
24
  p({
24
25
  apiKey: {
25
26
  ...r.apiKey,
26
27
  token: e
27
28
  }
28
- }), r.preferredSecurityScheme && F.emit({
29
- updateAuth: {
30
- nameKey: r.preferredSecurityScheme,
31
- propertyKey: "value",
32
- value: e
33
- }
34
- });
29
+ }), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
30
+ nameKey: r.preferredSecurityScheme,
31
+ propertyKey: "value",
32
+ value: e
33
+ }));
35
34
  }, D = (t) => {
35
+ var o;
36
36
  const e = t.target.value;
37
37
  p({
38
38
  http: {
@@ -42,14 +42,13 @@ const ke = /* @__PURE__ */ Q({
42
42
  username: e
43
43
  }
44
44
  }
45
- }), r.preferredSecurityScheme && F.emit({
46
- updateAuth: {
47
- nameKey: r.preferredSecurityScheme,
48
- propertyKey: "username",
49
- value: e
50
- }
51
- });
45
+ }), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
46
+ nameKey: r.preferredSecurityScheme,
47
+ propertyKey: "username",
48
+ value: e
49
+ }));
52
50
  }, E = (t) => {
51
+ var o;
53
52
  const e = t.target.value;
54
53
  p({
55
54
  http: {
@@ -59,14 +58,13 @@ const ke = /* @__PURE__ */ Q({
59
58
  password: e
60
59
  }
61
60
  }
62
- }), r.preferredSecurityScheme && F.emit({
63
- updateAuth: {
64
- nameKey: r.preferredSecurityScheme,
65
- propertyKey: "password",
66
- value: e
67
- }
68
- });
61
+ }), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
62
+ nameKey: r.preferredSecurityScheme,
63
+ propertyKey: "password",
64
+ value: e
65
+ }));
69
66
  }, H = (t) => {
67
+ var o;
70
68
  const e = t.target.value;
71
69
  p({
72
70
  http: {
@@ -76,14 +74,12 @@ const ke = /* @__PURE__ */ Q({
76
74
  token: e
77
75
  }
78
76
  }
79
- }), r.preferredSecurityScheme && F.emit({
80
- updateAuth: {
81
- nameKey: r.preferredSecurityScheme,
82
- propertyKey: "token",
83
- value: e
84
- }
85
- });
86
- }, B = (t) => {
77
+ }), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
78
+ nameKey: r.preferredSecurityScheme,
79
+ propertyKey: "token",
80
+ value: e
81
+ }));
82
+ }, z = (t) => {
87
83
  p({
88
84
  oAuth2: {
89
85
  ...r.oAuth2,
@@ -106,57 +102,57 @@ const ke = /* @__PURE__ */ Q({
106
102
  });
107
103
  };
108
104
  function $(t) {
109
- const e = r.oAuth2.scopes.join(" "), n = (Math.random() + 1).toString(36).substring(7), o = new URL(t.authorizationUrl);
105
+ const e = r.oAuth2.scopes.join(" "), o = (Math.random() + 1).toString(36).substring(7), a = new URL(t.authorizationUrl);
110
106
  return p({
111
- oAuth2: { ...r.oAuth2, state: n }
112
- }), o.searchParams.set("response_type", "token"), o.searchParams.set("client_id", r.oAuth2.clientId), o.searchParams.set("redirect_uri", window.location.href), o.searchParams.set("scope", e), o.searchParams.set("state", n), o.toString();
107
+ oAuth2: { ...r.oAuth2, state: o }
108
+ }), a.searchParams.set("response_type", "token"), a.searchParams.set("client_id", r.oAuth2.clientId), a.searchParams.set("redirect_uri", window.location.href), a.searchParams.set("scope", e), a.searchParams.set("state", o), a.toString();
113
109
  }
114
110
  function q(t, e) {
115
111
  if (typeof t != "string") {
116
112
  console.log("tokenUrl is not a string");
117
113
  return;
118
114
  }
119
- const n = e != null && e.baseUrl && !t.startsWith("http") ? x(e == null ? void 0 : e.baseUrl, t) : t, o = new URL(n);
120
- o.searchParams.set("grant_type", "password"), o.searchParams.set("username", r.oAuth2.username), o.searchParams.set("password", r.oAuth2.password), o.searchParams.set("client_id", r.oAuth2.clientId), o.searchParams.set("scope", r.oAuth2.scopes.join(" ")), fetch(
121
- e != null && e.proxy ? _(e == null ? void 0 : e.proxy, o.toString()) : o.toString(),
115
+ const o = e != null && e.baseUrl && !t.startsWith("http") ? x(e == null ? void 0 : e.baseUrl, t) : t, a = new URL(o);
116
+ a.searchParams.set("grant_type", "password"), a.searchParams.set("username", r.oAuth2.username), a.searchParams.set("password", r.oAuth2.password), a.searchParams.set("client_id", r.oAuth2.clientId), a.searchParams.set("scope", r.oAuth2.scopes.join(" ")), fetch(
117
+ e != null && e.proxy ? _(e == null ? void 0 : e.proxy, a.toString()) : a.toString(),
122
118
  {
123
119
  method: "POST",
124
120
  headers: {
125
121
  "Content-Type": "application/x-www-form-urlencoded"
126
122
  }
127
123
  }
128
- ).then((s) => {
129
- if (!s.ok)
124
+ ).then((u) => {
125
+ if (!u.ok)
130
126
  throw new Error(
131
127
  "Failed to get an access token. Please check your credentials."
132
128
  );
133
- return s.json();
134
- }).then((s) => {
129
+ return u.json();
130
+ }).then((u) => {
135
131
  p({
136
- oAuth2: { ...r.oAuth2, accessToken: s.access_token }
132
+ oAuth2: { ...r.oAuth2, accessToken: u.access_token }
137
133
  });
138
- }).catch((s) => {
134
+ }).catch((u) => {
139
135
  L("Couldn’t retrieve the password grant token", "warn", {
140
136
  description: "Open your browser console to get more information."
141
- }), console.error("[authorizeWithPassword]", s);
137
+ }), console.error("[authorizeWithPassword]", u);
142
138
  });
143
139
  }
144
- const C = X({
140
+ const T = X({
145
141
  get: () => r.oAuth2.scopes,
146
142
  set: (t) => p({ oAuth2: { ...r.oAuth2, scopes: t } })
147
143
  }), J = (t) => {
148
- const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
149
- if (n) {
150
- const o = setInterval(function() {
151
- var s;
144
+ const o = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
145
+ if (o) {
146
+ const a = setInterval(function() {
147
+ var u;
152
148
  try {
153
- const c = new URLSearchParams(n.location.href).get("access_token");
154
- if (n.closed || c) {
155
- clearInterval(o);
156
- const w = (s = n.location.href.match(/state=([^&]*)/)) == null ? void 0 : s[1];
149
+ const c = new URLSearchParams(o.location.href).get("access_token");
150
+ if (o.closed || c) {
151
+ clearInterval(a);
152
+ const w = (u = o.location.href.match(/state=([^&]*)/)) == null ? void 0 : u[1];
157
153
  c && r.oAuth2.state === w && p({
158
154
  oAuth2: { ...r.oAuth2, accessToken: c }
159
- }), n.close();
155
+ }), o.close();
160
156
  }
161
157
  } catch {
162
158
  }
@@ -164,41 +160,41 @@ const ke = /* @__PURE__ */ Q({
164
160
  }
165
161
  };
166
162
  return (t, e) => {
167
- var n;
168
- return t.value && ((n = t.value) != null && n.type) ? (l(), m(te, {
163
+ var o;
164
+ return t.value && ((o = t.value) != null && o.type) ? (n(), m(te, {
169
165
  key: 0,
170
166
  onSubmit: e[5] || (e[5] = Y(() => {
171
167
  }, ["prevent"]))
172
168
  }, {
173
- default: a(() => [
174
- t.value.type === "apiKey" ? (l(), m(f, {
169
+ default: s(() => [
170
+ t.value.type === "apiKey" ? (n(), m(f, {
175
171
  key: 0,
176
172
  id: `security-scheme-${t.value.name}`,
177
173
  placeholder: "Token",
178
174
  type: "password",
179
- value: u(r).apiKey.token,
175
+ value: l(r).apiKey.token,
180
176
  onInput: V
181
177
  }, {
182
- default: a(() => {
183
- var o, s, h;
178
+ default: s(() => {
179
+ var a, u, h;
184
180
  return [
185
- t.value.in ? (l(), U(K, { key: 0 }, [
186
- i(Z(((s = (o = t.value.in) == null ? void 0 : o.charAt(0)) == null ? void 0 : s.toUpperCase()) + ((h = t.value.in) == null ? void 0 : h.slice(1))), 1)
181
+ t.value.in ? (n(), K(F, { key: 0 }, [
182
+ i(Z(((u = (a = t.value.in) == null ? void 0 : a.charAt(0)) == null ? void 0 : u.toUpperCase()) + ((h = t.value.in) == null ? void 0 : h.slice(1))), 1)
187
183
  ], 64)) : v("", !0),
188
184
  e[6] || (e[6] = i(" API "))
189
185
  ];
190
186
  }),
191
187
  _: 1
192
- }, 8, ["id", "value"])) : t.value.type === "http" || t.value.type === "basic" ? (l(), U(K, { key: 1 }, [
193
- t.value.type === "basic" || t.value.scheme === "basic" ? (l(), m(P, { key: 0 }, {
194
- default: a(() => [
188
+ }, 8, ["id", "value"])) : t.value.type === "http" || t.value.type === "basic" ? (n(), K(F, { key: 1 }, [
189
+ t.value.type === "basic" || t.value.scheme === "basic" ? (n(), m(P, { key: 0 }, {
190
+ default: s(() => [
195
191
  d(f, {
196
192
  id: "http.basic.username",
197
193
  placeholder: "Username",
198
- value: u(r).http.basic.username,
194
+ value: l(r).http.basic.username,
199
195
  onInput: D
200
196
  }, {
201
- default: a(() => e[7] || (e[7] = [
197
+ default: s(() => e[7] || (e[7] = [
202
198
  i(" Username ")
203
199
  ])),
204
200
  _: 1
@@ -207,73 +203,73 @@ const ke = /* @__PURE__ */ Q({
207
203
  id: "http.basic.password",
208
204
  placeholder: "Password",
209
205
  type: "password",
210
- value: u(r).http.basic.password,
206
+ value: l(r).http.basic.password,
211
207
  onInput: E
212
208
  }, {
213
- default: a(() => e[8] || (e[8] = [
209
+ default: s(() => e[8] || (e[8] = [
214
210
  i(" Password ")
215
211
  ])),
216
212
  _: 1
217
213
  }, 8, ["value"])
218
214
  ]),
219
215
  _: 1
220
- })) : t.value.type === "http" && t.value.scheme === "bearer" ? (l(), m(f, {
216
+ })) : t.value.type === "http" && t.value.scheme === "bearer" ? (n(), m(f, {
221
217
  key: 1,
222
218
  id: "http.bearer.token",
223
219
  placeholder: "Token",
224
220
  type: "password",
225
- value: u(r).http.bearer.token,
221
+ value: l(r).http.bearer.token,
226
222
  onInput: H
227
223
  }, {
228
- default: a(() => e[9] || (e[9] = [
224
+ default: s(() => e[9] || (e[9] = [
229
225
  i(" Bearer Token ")
230
226
  ])),
231
227
  _: 1
232
228
  }, 8, ["value"])) : v("", !0)
233
- ], 64)) : t.value.type.toLowerCase() === "oauth2" && t.value.flows ? (l(), m(P, { key: 2 }, {
234
- default: a(() => {
235
- var o, s;
229
+ ], 64)) : t.value.type.toLowerCase() === "oauth2" && t.value.flows ? (n(), m(P, { key: 2 }, {
230
+ default: s(() => {
231
+ var a, u;
236
232
  return [
237
- t.value.flows.implicit ? (l(), U(K, { key: 0 }, [
238
- u(r).oAuth2.accessToken ? (l(), U(K, { key: 0 }, [
233
+ t.value.flows.implicit ? (n(), K(F, { key: 0 }, [
234
+ l(r).oAuth2.accessToken ? (n(), K(F, { key: 0 }, [
239
235
  d(f, {
240
236
  id: "oAuth2.accessToken",
241
237
  placeholder: "xxxxx",
242
238
  type: "password",
243
- value: u(r).oAuth2.accessToken
239
+ value: l(r).oAuth2.accessToken
244
240
  }, {
245
- default: a(() => e[10] || (e[10] = [
241
+ default: s(() => e[10] || (e[10] = [
246
242
  i(" Access Token ")
247
243
  ])),
248
244
  _: 1
249
245
  }, 8, ["value"]),
250
246
  d(re, {
251
- onClick: e[0] || (e[0] = () => u(p)({
247
+ onClick: e[0] || (e[0] = () => l(p)({
252
248
  oAuth2: {
253
- ...u(r).oAuth2,
249
+ ...l(r).oAuth2,
254
250
  accessToken: "",
255
251
  state: ""
256
252
  }
257
253
  }))
258
254
  }, {
259
- default: a(() => e[11] || (e[11] = [
255
+ default: s(() => e[11] || (e[11] = [
260
256
  i(" Reset ")
261
257
  ])),
262
258
  _: 1
263
259
  })
264
260
  ], 64)) : v("", !0)
265
261
  ], 64)) : v("", !0),
266
- (s = (o = t.value) == null ? void 0 : o.flows) != null && s.password ? (l(), m(j, { key: 1 }, {
267
- default: a(() => [
262
+ (u = (a = t.value) == null ? void 0 : a.flows) != null && u.password ? (n(), m(j, { key: 1 }, {
263
+ default: s(() => [
268
264
  d(P, null, {
269
- default: a(() => [
265
+ default: s(() => [
270
266
  d(f, {
271
267
  id: "oAuth2.username",
272
268
  placeholder: "Username",
273
- value: u(r).oAuth2.username,
269
+ value: l(r).oAuth2.username,
274
270
  onInput: M
275
271
  }, {
276
- default: a(() => e[12] || (e[12] = [
272
+ default: s(() => e[12] || (e[12] = [
277
273
  i(" Username ")
278
274
  ])),
279
275
  _: 1
@@ -282,10 +278,10 @@ const ke = /* @__PURE__ */ Q({
282
278
  id: "oAuth2.password",
283
279
  placeholder: "Password",
284
280
  type: "password",
285
- value: u(r).oAuth2.password,
281
+ value: l(r).oAuth2.password,
286
282
  onInput: G
287
283
  }, {
288
- default: a(() => e[13] || (e[13] = [
284
+ default: s(() => e[13] || (e[13] = [
289
285
  i(" Password ")
290
286
  ])),
291
287
  _: 1
@@ -294,38 +290,38 @@ const ke = /* @__PURE__ */ Q({
294
290
  _: 1
295
291
  }),
296
292
  d(P, null, {
297
- default: a(() => {
298
- var h, c, w, A, k, S, y, b, I, g, z;
293
+ default: s(() => {
294
+ var h, c, w, A, k, S, y, b, I, g, B;
299
295
  return [
300
296
  d(f, {
301
297
  id: "oAuth2.clientId",
302
298
  placeholder: "12345",
303
299
  type: "text",
304
- value: u(r).oAuth2.clientId,
305
- onInput: B
300
+ value: l(r).oAuth2.clientId,
301
+ onInput: z
306
302
  }, {
307
- default: a(() => e[14] || (e[14] = [
303
+ default: s(() => e[14] || (e[14] = [
308
304
  i(" Client ID ")
309
305
  ])),
310
306
  _: 1
311
307
  }, 8, ["value"]),
312
308
  t.value !== void 0 && Object.entries(
313
309
  ((w = (c = (h = t.value) == null ? void 0 : h.flows) == null ? void 0 : c.implicit) == null ? void 0 : w.scopes) ?? ((S = (k = (A = t.value) == null ? void 0 : A.flows) == null ? void 0 : k.password) == null ? void 0 : S.scopes) ?? {}
314
- ).length > 0 ? (l(), m(R, {
310
+ ).length > 0 ? (n(), m(R, {
315
311
  key: 0,
316
- selected: C.value,
317
- "onUpdate:selected": e[1] || (e[1] = (T) => C.value = T),
318
- scopes: ((I = (b = (y = t.value) == null ? void 0 : y.flows) == null ? void 0 : b.implicit) == null ? void 0 : I.scopes) ?? ((z = (g = t.value) == null ? void 0 : g.flows) == null ? void 0 : z.password.scopes)
312
+ selected: T.value,
313
+ "onUpdate:selected": e[1] || (e[1] = (U) => T.value = U),
314
+ scopes: ((I = (b = (y = t.value) == null ? void 0 : y.flows) == null ? void 0 : b.implicit) == null ? void 0 : I.scopes) ?? ((B = (g = t.value) == null ? void 0 : g.flows) == null ? void 0 : B.password.scopes)
319
315
  }, null, 8, ["selected", "scopes"])) : v("", !0),
320
316
  W("button", {
321
317
  class: "cardform-auth-button",
322
318
  type: "button",
323
319
  onClick: e[2] || (e[2] = () => {
324
- var T, O;
320
+ var U, O;
325
321
  return q(
326
- (O = (T = t.value.flows) == null ? void 0 : T.password) == null ? void 0 : O.tokenUrl,
322
+ (O = (U = t.value.flows) == null ? void 0 : U.password) == null ? void 0 : O.tokenUrl,
327
323
  {
328
- baseUrl: u(ae)(u(N)),
324
+ baseUrl: l(ae)(l(N)),
329
325
  proxy: t.proxy
330
326
  }
331
327
  );
@@ -337,30 +333,30 @@ const ke = /* @__PURE__ */ Q({
337
333
  })
338
334
  ]),
339
335
  _: 1
340
- })) : (l(), m(j, { key: 2 }, {
341
- default: a(() => [
336
+ })) : (n(), m(j, { key: 2 }, {
337
+ default: s(() => [
342
338
  d(P, null, {
343
- default: a(() => {
339
+ default: s(() => {
344
340
  var h, c, w, A, k, S;
345
341
  return [
346
342
  d(f, {
347
343
  id: "oAuth2.clientId",
348
344
  placeholder: "12345",
349
345
  type: "text",
350
- value: u(r).oAuth2.clientId,
351
- onInput: B
346
+ value: l(r).oAuth2.clientId,
347
+ onInput: z
352
348
  }, {
353
- default: a(() => e[15] || (e[15] = [
349
+ default: s(() => e[15] || (e[15] = [
354
350
  i(" Client ID ")
355
351
  ])),
356
352
  _: 1
357
353
  }, 8, ["value"]),
358
354
  t.value !== void 0 && Object.entries(
359
355
  ((h = t.value.flows.implicit) == null ? void 0 : h.scopes) ?? ((c = t.value.flows.password) == null ? void 0 : c.scopes) ?? ((w = t.value.flows.authorizationCode) == null ? void 0 : w.scopes)
360
- ).length > 0 ? (l(), m(R, {
356
+ ).length > 0 ? (n(), m(R, {
361
357
  key: 0,
362
- selected: C.value,
363
- "onUpdate:selected": e[3] || (e[3] = (y) => C.value = y),
358
+ selected: T.value,
359
+ "onUpdate:selected": e[3] || (e[3] = (y) => T.value = y),
364
360
  scopes: ((A = t.value.flows.implicit) == null ? void 0 : A.scopes) ?? ((k = t.value.flows.password) == null ? void 0 : k.scopes) ?? ((S = t.value.flows.authorizationCode) == null ? void 0 : S.scopes)
365
361
  }, null, 8, ["selected", "scopes"])) : v("", !0),
366
362
  W("button", {
@@ -393,5 +389,5 @@ const ke = /* @__PURE__ */ Q({
393
389
  }
394
390
  });
395
391
  export {
396
- ke as default
392
+ Se as default
397
393
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SecuritySchemeSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecuritySchemeSelector.vue"],"names":[],"mappings":"AA8KA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;YASxE,SAAS,CAAC,yBAAyB,GACnC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC7C,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;;;;YAF/C,SAAS,CAAC,yBAAyB,GACnC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC7C,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;;;;AAwNrD,wBASG"}
1
+ {"version":3,"file":"SecuritySchemeSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecuritySchemeSelector.vue"],"names":[],"mappings":"AAiMA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;YAUxE,SAAS,CAAC,yBAAyB,GACnC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC7C,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;;;;YAF/C,SAAS,CAAC,yBAAyB,GACnC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC7C,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;;;;AA0OrD,wBASG"}
@@ -1,7 +1,7 @@
1
1
  import e from "./SecuritySchemeSelector.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ o(e, [["__scopeId", "data-v-e94bff6c"]]);
4
+ const f = /* @__PURE__ */ o(e, [["__scopeId", "data-v-14fe4cfc"]]);
5
5
  export {
6
6
  f as default
7
7
  };
@@ -1,73 +1,83 @@
1
- import { defineComponent as N, onMounted as O, onServerPrefetch as V, computed as l, openBlock as d, createElementBlock as x, toDisplayString as y, createBlock as _, unref as r, withCtx as f, createVNode as S, createElementVNode as j, createTextVNode as z, createCommentVNode as I } from "vue";
2
- import { ScalarListbox as K, ScalarButton as P, ScalarIcon as $ } from "@scalar/components";
3
- import { useAuthenticationStore as D } from "../stores/useAuthenticationStore.js";
4
- const E = {
1
+ import { defineComponent as _, onMounted as z, onServerPrefetch as I, computed as l, openBlock as S, createElementBlock as K, toDisplayString as m, createBlock as P, unref as s, withCtx as v, createVNode as b, createElementVNode as U, createTextVNode as $, createCommentVNode as D } from "vue";
2
+ import { ScalarListbox as E, ScalarButton as H, ScalarIcon as M } from "@scalar/components";
3
+ import { useApiClient as T } from "../../features/ApiClientModal/useApiClient.js";
4
+ import { useAuthenticationStore as F } from "../stores/useAuthenticationStore.js";
5
+ const W = {
5
6
  key: 0,
6
7
  class: "security-scheme-label"
7
- }, M = /* @__PURE__ */ N({
8
+ }, R = /* @__PURE__ */ _({
8
9
  __name: "SecuritySchemeSelector",
9
10
  props: {
10
11
  value: {}
11
12
  },
12
13
  emits: ["input"],
13
- setup(m, { emit: v }) {
14
- const a = m, b = v, { authentication: o, setAuthentication: A } = D();
15
- O(() => {
16
- o.preferredSecurityScheme || u(Object.keys(a.value ?? {})[0] ?? null);
14
+ setup(A, { emit: w }) {
15
+ const i = A, C = w, { authentication: c, setAuthentication: O } = F(), { client: p } = T();
16
+ z(() => {
17
+ c.preferredSecurityScheme || u(Object.keys(i.value ?? {})[0] ?? null);
17
18
  });
18
19
  const u = (e) => {
19
- A({
20
+ var t;
21
+ if (O({
20
22
  preferredSecurityScheme: e
21
- }), b("input", e);
23
+ }), (t = p.value) != null && t.store) {
24
+ const { collections: r, collectionMutators: o, securitySchemes: j } = p.value.store, f = Object.keys(r)[0], y = Object.values(j).find(
25
+ ({ nameKey: x }) => x === e
26
+ );
27
+ y && f && o.edit(f, "selectedSecuritySchemeUids", [
28
+ y.uid
29
+ ]);
30
+ }
31
+ C("input", e);
22
32
  };
23
- V(
24
- () => u(Object.keys(a.value ?? {})[0] ?? null)
33
+ I(
34
+ () => u(Object.keys(i.value ?? {})[0] ?? null)
25
35
  );
26
- const w = (e) => !(e != null && e.type), C = (e) => e.type.toLowerCase() === "apikey", B = (e) => e.type === "http" && e.scheme.toLowerCase() === "basic" || e.type.toLowerCase() === "basic", L = (e) => e.type === "http" && e.scheme.toLowerCase() === "bearer", g = (e) => e.type.toLowerCase() === "oauth2", i = (e, t) => `${k(e)} (${t})`, k = (e) => {
27
- var t, n;
28
- return w(e) ? "No Authentication" : C(e) ? "API Key" : B(e) ? "Basic Authentication" : L(e) ? "Bearer Authentication" : g(e) ? (t = e.flows) != null && t.implicit ? "OAuth 2.0 Implicit" : (n = e.flows) != null && n.password ? "OAuth 2.0 Password" : "OAuth 2.0" : `${e.type} (not yet supported)`;
29
- }, s = l(() => Object.keys(a.value ?? {})), p = l(
30
- () => s.value.map((e) => {
36
+ const B = (e) => !(e != null && e.type), L = (e) => e.type.toLowerCase() === "apikey", g = (e) => e.type === "http" && e.scheme.toLowerCase() === "basic" || e.type.toLowerCase() === "basic", k = (e) => e.type === "http" && e.scheme.toLowerCase() === "bearer", N = (e) => e.type.toLowerCase() === "oauth2", a = (e, t) => `${V(e)} (${t})`, V = (e) => {
37
+ var t, r;
38
+ return B(e) ? "No Authentication" : L(e) ? "API Key" : g(e) ? "Basic Authentication" : k(e) ? "Bearer Authentication" : N(e) ? (t = e.flows) != null && t.implicit ? "OAuth 2.0 Implicit" : (r = e.flows) != null && r.password ? "OAuth 2.0 Password" : "OAuth 2.0" : `${e.type} (not yet supported)`;
39
+ }, n = l(() => Object.keys(i.value ?? {})), d = l(
40
+ () => n.value.map((e) => {
31
41
  var t;
32
42
  return {
33
43
  id: e,
34
- label: i((t = a.value) == null ? void 0 : t[e], e)
44
+ label: a((t = i.value) == null ? void 0 : t[e], e)
35
45
  };
36
46
  })
37
47
  ), h = l({
38
48
  get: () => {
39
49
  var e;
40
- return (e = p.value) == null ? void 0 : e.find(
41
- (t) => t.id === o.preferredSecurityScheme
50
+ return (e = d.value) == null ? void 0 : e.find(
51
+ (t) => t.id === c.preferredSecurityScheme
42
52
  );
43
53
  },
44
54
  set: (e) => u((e == null ? void 0 : e.id) ?? "")
45
55
  });
46
56
  return (e, t) => {
47
- var n;
48
- return s.value.length === 1 ? (d(), x("div", E, y(i((n = e.value) == null ? void 0 : n[s.value[0]], s.value[0])), 1)) : s.value.length > 1 ? (d(), _(r(K), {
57
+ var r;
58
+ return n.value.length === 1 ? (S(), K("div", W, m(a((r = e.value) == null ? void 0 : r[n.value[0]], n.value[0])), 1)) : n.value.length > 1 ? (S(), P(s(E), {
49
59
  key: 1,
50
60
  modelValue: h.value,
51
- "onUpdate:modelValue": t[0] || (t[0] = (c) => h.value = c),
61
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => h.value = o),
52
62
  label: "Security Scheme",
53
- options: p.value,
63
+ options: d.value,
54
64
  resize: ""
55
65
  }, {
56
- default: f(() => [
57
- S(r(P), {
66
+ default: v(() => [
67
+ b(s(H), {
58
68
  class: "security-scheme-button",
59
69
  fullWidth: "",
60
70
  variant: "ghost"
61
71
  }, {
62
- default: f(() => {
63
- var c;
72
+ default: v(() => {
73
+ var o;
64
74
  return [
65
- t[1] || (t[1] = j("span", { class: "sr-only" }, "Selected:", -1)),
66
- z(" " + y(r(o).preferredSecurityScheme ? i(
67
- (c = e.value) == null ? void 0 : c[r(o).preferredSecurityScheme],
68
- r(o).preferredSecurityScheme
75
+ t[1] || (t[1] = U("span", { class: "sr-only" }, "Selected:", -1)),
76
+ $(" " + m(s(c).preferredSecurityScheme ? a(
77
+ (o = e.value) == null ? void 0 : o[s(c).preferredSecurityScheme],
78
+ s(c).preferredSecurityScheme
69
79
  ) : "No Authentication") + " ", 1),
70
- S(r($), {
80
+ b(s(M), {
71
81
  icon: "ChevronDown",
72
82
  size: "xs"
73
83
  })
@@ -77,10 +87,10 @@ const E = {
77
87
  })
78
88
  ]),
79
89
  _: 1
80
- }, 8, ["modelValue", "options"])) : I("", !0);
90
+ }, 8, ["modelValue", "options"])) : D("", !0);
81
91
  };
82
92
  }
83
93
  });
84
94
  export {
85
- M as default
95
+ R as default
86
96
  };
@@ -1,4 +1,4 @@
1
- export * from './createPlaceholderRequest.js';
1
+ export * from './createPlaceholderRequest';
2
2
  export * from './encodeStringAsBase64.js';
3
3
  export * from './getRequestFromAuthentication.js';
4
4
  export * from './getUrlFromServerState.js';
@@ -1,6 +1,5 @@
1
- export * from './useApiClientStore.js';
2
1
  export * from './useAuthenticationStore.js';
3
2
  export * from './useOpenApiStore.js';
4
- export * from './useRequestStore.js';
3
+ export * from './useRequestStore';
5
4
  export * from './useServerStore.js';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}