@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.
- package/CHANGELOG.md +15 -0
- package/dist/browser/standalone.js +11608 -11548
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +17 -17
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +2 -2
- package/dist/features/BaseUrl/ServerVariablesSelect.vue2.js +26 -21
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +5 -5
- package/dist/helpers/getApiClientRequest.js +19 -19
- package/dist/helpers/getExampleCode.d.ts.map +1 -1
- package/dist/helpers/getExampleCode.js +16 -14
- package/dist/index.js +1 -1
- package/dist/legacy/components/SecurityScheme.vue.js +2 -2
- package/dist/legacy/components/SecurityScheme.vue2.js +8 -8
- package/dist/legacy/helpers/getUrlFromServerState.d.ts +4 -1
- package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -1
- package/dist/legacy/helpers/getUrlFromServerState.js +15 -6
- package/dist/legacy/stores/useServerStore.d.ts.map +1 -1
- package/dist/legacy/stores/useServerStore.js +47 -36
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -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
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a744ab96"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
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
|
|
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:
|
|
313
|
-
"onUpdate:selected": e[1] || (e[1] = (
|
|
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
|
|
320
|
+
var T, O;
|
|
321
321
|
return q(
|
|
322
|
-
(O = (
|
|
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:
|
|
359
|
-
"onUpdate:selected": e[3] || (e[3] = (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):
|
|
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
|
|
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
|
|
2
|
-
function
|
|
3
|
-
var u,
|
|
4
|
-
const l = (u =
|
|
5
|
-
|
|
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
|
-
|
|
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,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,KAAK,GAAG,EAAmB,MAAM,KAAK,CAAA;AAK/C,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,IAAI,GAAG,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE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,CAAA;SAAE;;0BAWT,OAAO,CAAC,WAAW,CAAC;CA4HhD,CAAA"}
|
|
@@ -1,64 +1,75 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { getServers as
|
|
3
|
-
import { createEmptySpecification as
|
|
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
|
-
}),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
25
|
+
function O(e) {
|
|
15
26
|
return Object.fromEntries(
|
|
16
|
-
Object.entries(
|
|
17
|
-
var
|
|
27
|
+
Object.entries(e ?? {}).map(([t, r]) => {
|
|
28
|
+
var b, a, m;
|
|
18
29
|
return [
|
|
19
|
-
|
|
30
|
+
t,
|
|
20
31
|
// 1) Default
|
|
21
|
-
((
|
|
22
|
-
((
|
|
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
|
|
39
|
+
function g(e, t) {
|
|
29
40
|
return Object.fromEntries(
|
|
30
|
-
Object.entries(
|
|
31
|
-
([
|
|
41
|
+
Object.entries(e).filter(
|
|
42
|
+
([r]) => r in (t.variables ?? {})
|
|
32
43
|
)
|
|
33
44
|
);
|
|
34
45
|
}
|
|
35
46
|
const V = ({
|
|
36
|
-
specification:
|
|
37
|
-
defaultServerUrl:
|
|
38
|
-
servers:
|
|
39
|
-
} = {}) => ((
|
|
40
|
-
() => [
|
|
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
|
|
53
|
+
const b = (
|
|
43
54
|
// Use the specification
|
|
44
|
-
(
|
|
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
|
-
|
|
47
|
-
servers:
|
|
57
|
+
v({
|
|
58
|
+
servers: r.value
|
|
48
59
|
})
|
|
49
60
|
)
|
|
50
|
-
),
|
|
51
|
-
defaultServerUrl:
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
servers:
|
|
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
|
-
...
|
|
68
|
+
...O((m == null ? void 0 : m.variables) ?? {}),
|
|
58
69
|
// Don’t overwrite existing values, but filter out non-existing variables
|
|
59
|
-
...
|
|
60
|
-
|
|
61
|
-
(
|
|
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:
|
|
72
|
-
setServer:
|
|
82
|
+
server: o,
|
|
83
|
+
setServer: n
|
|
73
84
|
});
|
|
74
85
|
export {
|
|
75
86
|
j as createEmptyServerState,
|