@scalar/api-reference 1.25.63 → 1.25.64

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.
@@ -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 c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b6e18839"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a744ab96"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };
@@ -137,7 +137,7 @@ const Se = /* @__PURE__ */ Q({
137
137
  }), console.error("[authorizeWithPassword]", u);
138
138
  });
139
139
  }
140
- const T = X({
140
+ const U = X({
141
141
  get: () => r.oAuth2.scopes,
142
142
  set: (t) => p({ oAuth2: { ...r.oAuth2, scopes: t } })
143
143
  }), J = (t) => {
@@ -309,19 +309,19 @@ const Se = /* @__PURE__ */ Q({
309
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) ?? {}
310
310
  ).length > 0 ? (n(), m(R, {
311
311
  key: 0,
312
- selected: T.value,
313
- "onUpdate:selected": e[1] || (e[1] = (U) => T.value = U),
312
+ selected: U.value,
313
+ "onUpdate:selected": e[1] || (e[1] = (T) => U.value = T),
314
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)
315
315
  }, null, 8, ["selected", "scopes"])) : v("", !0),
316
316
  W("button", {
317
317
  class: "cardform-auth-button",
318
318
  type: "button",
319
319
  onClick: e[2] || (e[2] = () => {
320
- var U, O;
320
+ var T, O;
321
321
  return q(
322
- (O = (U = t.value.flows) == null ? void 0 : U.password) == null ? void 0 : O.tokenUrl,
322
+ (O = (T = t.value.flows) == null ? void 0 : T.password) == null ? void 0 : O.tokenUrl,
323
323
  {
324
- baseUrl: l(ae)(l(N)),
324
+ baseUrl: l(ae)(l(N)).modifiedUrl,
325
325
  proxy: t.proxy
326
326
  }
327
327
  );
@@ -355,8 +355,8 @@ const Se = /* @__PURE__ */ Q({
355
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)
356
356
  ).length > 0 ? (n(), m(R, {
357
357
  key: 0,
358
- selected: T.value,
359
- "onUpdate:selected": e[3] || (e[3] = (y) => T.value = y),
358
+ selected: U.value,
359
+ "onUpdate:selected": e[3] || (e[3] = (y) => U.value = y),
360
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)
361
361
  }, null, 8, ["selected", "scopes"])) : v("", !0),
362
362
  W("button", {
@@ -2,5 +2,8 @@ import type { ServerState } from '#legacy';
2
2
  /**
3
3
  * Get the URL from the server state.
4
4
  */
5
- export declare function getUrlFromServerState(state: ServerState): string | undefined;
5
+ export declare function getUrlFromServerState(state: ServerState): {
6
+ originalUrl: string | undefined;
7
+ modifiedUrl: string | undefined;
8
+ };
6
9
  //# sourceMappingURL=getUrlFromServerState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUrlFromServerState.d.ts","sourceRoot":"","sources":["../../../src/legacy/helpers/getUrlFromServerState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,sBAevD"}
1
+ {"version":3,"file":"getUrlFromServerState.d.ts","sourceRoot":"","sources":["../../../src/legacy/helpers/getUrlFromServerState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW;;;EAgCvD"}
@@ -1,9 +1,18 @@
1
- import { replaceVariables as o } from "@scalar/oas-utils/helpers";
2
- function f(r) {
3
- var u, i;
4
- const l = (u = r == null ? void 0 : r.servers) == null ? void 0 : u[r.selectedServer ?? 0];
5
- return (i = l == null ? void 0 : l.url) != null && i.endsWith("/") && (l.url = l.url.slice(0, -1)), typeof (l == null ? void 0 : l.url) == "string" ? o(l == null ? void 0 : l.url, r.variables) : l == null ? void 0 : l.url;
1
+ import { replaceVariables as a, REGEX as g } from "@scalar/oas-utils/helpers";
2
+ function _(o) {
3
+ var u, e;
4
+ const l = (u = o == null ? void 0 : o.servers) == null ? void 0 : u[o.selectedServer ?? 0];
5
+ (e = l == null ? void 0 : l.url) != null && e.endsWith("/") && (l.url = l.url.slice(0, -1));
6
+ const d = l == null ? void 0 : l.url, n = typeof (l == null ? void 0 : l.url) == "string" ? a(l == null ? void 0 : l.url, o.variables) : l == null ? void 0 : l.url, r = n == null ? void 0 : n.match(g.PATH), f = (r == null ? void 0 : r.reduce((i, p) => {
7
+ var m;
8
+ const c = p.replace(/{|}/g, ""), t = (m = o.variables) == null ? void 0 : m[c];
9
+ return i == null ? void 0 : i.replace(
10
+ p,
11
+ t || `__${c.toUpperCase()}__`
12
+ );
13
+ }, n)) ?? n;
14
+ return { originalUrl: d, modifiedUrl: f };
6
15
  }
7
16
  export {
8
- f as getUrlFromServerState
17
+ _ as getUrlFromServerState
9
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useServerStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useServerStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MA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C7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,EAAE,CAAA;IAC/D,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,sBAAsB,QAAO,WAIxC,CAAA;AA+DF,eAAO,MAAM,cAAc,mDAIxB;IACD,aAAa,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,CAAA;IACrC;;OAEG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CACX,CAAC,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,EAAE,GAAG,SAAS,CAClE,CAAA;CACF;;wBAzFiB,IAAI,GAAG,MAAM;sBACf,MAAM;;;;;;;;;;;;mBAET;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE;;0BAWT,OAAO,CAAC,WAAW,CAAC;CA4HhD,CAAA"}
@@ -1,64 +1,75 @@
1
- import { reactive as u, watch as g } from "vue";
2
- import { getServers as S } from "../../features/BaseUrl/utils/getServers.js";
3
- import { createEmptySpecification as b } from "../../helpers/createEmptySpecification.js";
1
+ import { reactive as l, watch as s } from "vue";
2
+ import { getServers as u } from "../../features/BaseUrl/utils/getServers.js";
3
+ import { createEmptySpecification as v } from "../../helpers/createEmptySpecification.js";
4
4
  const j = () => ({
5
5
  selectedServer: null,
6
6
  servers: [],
7
7
  variables: {}
8
- }), r = u(j()), v = (t) => {
9
- Object.assign(r, {
10
- ...r,
11
- ...t
8
+ }), o = l(j()), n = (e) => {
9
+ var b;
10
+ const t = (b = o.servers) == null ? void 0 : b[e.selectedServer ?? o.selectedServer ?? 0], r = t != null && t.variables ? Object.fromEntries(
11
+ Object.entries(t.variables).map(([a, m]) => [
12
+ a,
13
+ m.default ?? ""
14
+ ])
15
+ ) : {};
16
+ Object.assign(o, {
17
+ ...o,
18
+ ...e,
19
+ variables: {
20
+ ...r,
21
+ ...e.variables
22
+ }
12
23
  });
13
24
  };
14
- function E(t) {
25
+ function O(e) {
15
26
  return Object.fromEntries(
16
- Object.entries(t ?? {}).map(([m, e]) => {
17
- var a, o, n;
27
+ Object.entries(e ?? {}).map(([t, r]) => {
28
+ var b, a, m;
18
29
  return [
19
- m,
30
+ t,
20
31
  // 1) Default
21
- ((a = e.default) == null ? void 0 : a.toString()) ?? // 2) First enum value
22
- ((n = (o = e.enum) == null ? void 0 : o[0]) == null ? void 0 : n.toString()) ?? // 3) Empty string
32
+ ((b = r.default) == null ? void 0 : b.toString()) ?? // 2) First enum value
33
+ ((m = (a = r.enum) == null ? void 0 : a[0]) == null ? void 0 : m.toString()) ?? // 3) Empty string
23
34
  ""
24
35
  ];
25
36
  })
26
37
  );
27
38
  }
28
- function O(t, m) {
39
+ function g(e, t) {
29
40
  return Object.fromEntries(
30
- Object.entries(t).filter(
31
- ([e]) => e in (m.variables ?? {})
41
+ Object.entries(e).filter(
42
+ ([r]) => r in (t.variables ?? {})
32
43
  )
33
44
  );
34
45
  }
35
46
  const V = ({
36
- specification: t,
37
- defaultServerUrl: m,
38
- servers: e
39
- } = {}) => ((t == null ? void 0 : t.value) !== void 0 && g(
40
- () => [t == null ? void 0 : t.value, e == null ? void 0 : e.value, m == null ? void 0 : m.value],
47
+ specification: e,
48
+ defaultServerUrl: t,
49
+ servers: r
50
+ } = {}) => ((e == null ? void 0 : e.value) !== void 0 && s(
51
+ () => [e == null ? void 0 : e.value, r == null ? void 0 : r.value, t == null ? void 0 : t.value],
41
52
  () => {
42
- const a = (
53
+ const b = (
43
54
  // Use the specification
44
- (e == null ? void 0 : e.value) === void 0 ? (t == null ? void 0 : t.value) ?? b() : (
55
+ (r == null ? void 0 : r.value) === void 0 ? (e == null ? void 0 : e.value) ?? v() : (
45
56
  // Or create an empty one with the specified servers list
46
- b({
47
- servers: e.value
57
+ v({
58
+ servers: r.value
48
59
  })
49
60
  )
50
- ), o = S(a, {
51
- defaultServerUrl: m == null ? void 0 : m.value
52
- }), n = o == null ? void 0 : o[r.selectedServer ?? 0];
53
- v({
54
- servers: o,
61
+ ), a = u(b, {
62
+ defaultServerUrl: t == null ? void 0 : t.value
63
+ }), m = a == null ? void 0 : a[o.selectedServer ?? 0];
64
+ n({
65
+ servers: a,
55
66
  variables: {
56
67
  // Set the initial values for the variables
57
- ...E((n == null ? void 0 : n.variables) ?? {}),
68
+ ...O((m == null ? void 0 : m.variables) ?? {}),
58
69
  // Don’t overwrite existing values, but filter out non-existing variables
59
- ...O(
60
- r.variables,
61
- (o == null ? void 0 : o[r.selectedServer ?? 0]) ?? {}
70
+ ...g(
71
+ o.variables,
72
+ (a == null ? void 0 : a[o.selectedServer ?? 0]) ?? {}
62
73
  )
63
74
  }
64
75
  });
@@ -68,8 +79,8 @@ const V = ({
68
79
  immediate: !0
69
80
  }
70
81
  ), {
71
- server: r,
72
- setServer: v
82
+ server: o,
83
+ setServer: n
73
84
  });
74
85
  export {
75
86
  j as createEmptyServerState,