@scalar/api-reference 1.25.71 → 1.25.72
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 +30 -0
- package/dist/browser/standalone.js +10875 -10813
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +56 -57
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +3 -3
- package/dist/components/ApiReferenceLayout.vue2.js +160 -143
- package/dist/components/Content/Authentication/Authentication.vue.d.ts +1 -1
- package/dist/components/Content/Authentication/Authentication.vue.d.ts.map +1 -1
- package/dist/components/Content/Authentication/Authentication.vue.js +2 -2
- package/dist/components/Content/Authentication/Authentication.vue2.js +20 -20
- package/dist/components/Content/Content.vue.d.ts +1 -1
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +1 -1
- package/dist/components/Content/Content.vue2.js +58 -52
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +42 -36
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +34 -28
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +22 -0
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
- package/dist/embeds/OpenApiDocument/types.d.ts +1 -1
- package/dist/embeds/OpenApiDocument/types.d.ts.map +1 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts +4 -4
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +124 -120
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +73 -63
- package/dist/helpers/getExampleCode.d.ts +2 -2
- package/dist/helpers/getExampleCode.d.ts.map +1 -1
- package/dist/helpers/getExampleCode.js +12 -11
- package/dist/helpers/parse.d.ts +2 -2
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +3 -3
- package/dist/hooks/useDeprecationWarnings.d.ts.map +1 -1
- package/dist/hooks/useDeprecationWarnings.js +12 -15
- package/dist/hooks/useReactiveSpec.d.ts +24 -2
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useReactiveSpec.js +4 -4
- package/dist/index.js +1 -1
- package/dist/legacy/components/SecurityScheme.vue.d.ts +1 -1
- package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -1
- package/dist/legacy/components/SecurityScheme.vue.js +2 -2
- package/dist/legacy/components/SecurityScheme.vue2.js +13 -13
- package/dist/legacy/helpers/getUrlFromServerState.d.ts +2 -1
- package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -1
- package/dist/legacy/helpers/getUrlFromServerState.js +14 -14
- package/dist/legacy/stores/useOpenApiStore.d.ts +22 -0
- package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
value?: OpenAPIV2.SecuritySchemeObject | OpenAPIV3.SecuritySchemeObject | OpenAPIV3_1.SecuritySchemeObject;
|
|
4
|
-
|
|
4
|
+
proxyUrl?: string;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
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;AAgB9E,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EACF,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA;IACpC,
|
|
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;AAgB9E,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EACF,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;AAguBF,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
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b6eca23a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -15,10 +15,10 @@ const Se = /* @__PURE__ */ Q({
|
|
|
15
15
|
__name: "SecurityScheme",
|
|
16
16
|
props: {
|
|
17
17
|
value: {},
|
|
18
|
-
|
|
18
|
+
proxyUrl: {}
|
|
19
19
|
},
|
|
20
20
|
setup(le) {
|
|
21
|
-
const { toast: L } = ee(), { client:
|
|
21
|
+
const { toast: L } = ee(), { client: U } = oe(), { server: N } = ae(), { authentication: r, setAuthentication: p } = ue(), V = (t) => {
|
|
22
22
|
var o;
|
|
23
23
|
const e = t.target.value;
|
|
24
24
|
p({
|
|
@@ -26,7 +26,7 @@ const Se = /* @__PURE__ */ Q({
|
|
|
26
26
|
...r.apiKey,
|
|
27
27
|
token: e
|
|
28
28
|
}
|
|
29
|
-
}), r.preferredSecurityScheme && ((o =
|
|
29
|
+
}), r.preferredSecurityScheme && ((o = U.value) == null || o.updateAuth({
|
|
30
30
|
nameKey: r.preferredSecurityScheme,
|
|
31
31
|
propertyKey: "value",
|
|
32
32
|
value: e
|
|
@@ -42,7 +42,7 @@ const Se = /* @__PURE__ */ Q({
|
|
|
42
42
|
username: e
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
}), r.preferredSecurityScheme && ((o =
|
|
45
|
+
}), r.preferredSecurityScheme && ((o = U.value) == null || o.updateAuth({
|
|
46
46
|
nameKey: r.preferredSecurityScheme,
|
|
47
47
|
propertyKey: "username",
|
|
48
48
|
value: e
|
|
@@ -58,7 +58,7 @@ const Se = /* @__PURE__ */ Q({
|
|
|
58
58
|
password: e
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
}), r.preferredSecurityScheme && ((o =
|
|
61
|
+
}), r.preferredSecurityScheme && ((o = U.value) == null || o.updateAuth({
|
|
62
62
|
nameKey: r.preferredSecurityScheme,
|
|
63
63
|
propertyKey: "password",
|
|
64
64
|
value: e
|
|
@@ -74,7 +74,7 @@ const Se = /* @__PURE__ */ Q({
|
|
|
74
74
|
token: e
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}), r.preferredSecurityScheme && ((o =
|
|
77
|
+
}), r.preferredSecurityScheme && ((o = U.value) == null || o.updateAuth({
|
|
78
78
|
nameKey: r.preferredSecurityScheme,
|
|
79
79
|
propertyKey: "token",
|
|
80
80
|
value: e
|
|
@@ -114,7 +114,7 @@ const Se = /* @__PURE__ */ Q({
|
|
|
114
114
|
}
|
|
115
115
|
const o = e != null && e.baseUrl && !t.startsWith("http") ? x(e == null ? void 0 : e.baseUrl, t) : t, a = new URL(o);
|
|
116
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.
|
|
117
|
+
e != null && e.proxyUrl ? _(e == null ? void 0 : e.proxyUrl, a.toString()) : a.toString(),
|
|
118
118
|
{
|
|
119
119
|
method: "POST",
|
|
120
120
|
headers: {
|
|
@@ -137,7 +137,7 @@ const Se = /* @__PURE__ */ Q({
|
|
|
137
137
|
}), console.error("[authorizeWithPassword]", u);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const C = X({
|
|
141
141
|
get: () => r.oAuth2.scopes,
|
|
142
142
|
set: (t) => p({ oAuth2: { ...r.oAuth2, scopes: t } })
|
|
143
143
|
}), J = (t) => {
|
|
@@ -309,8 +309,8 @@ 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] = (T) =>
|
|
312
|
+
selected: C.value,
|
|
313
|
+
"onUpdate:selected": e[1] || (e[1] = (T) => C.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", {
|
|
@@ -322,7 +322,7 @@ const Se = /* @__PURE__ */ Q({
|
|
|
322
322
|
(O = (T = t.value.flows) == null ? void 0 : T.password) == null ? void 0 : O.tokenUrl,
|
|
323
323
|
{
|
|
324
324
|
baseUrl: l(se)(l(N)).modifiedUrl,
|
|
325
|
-
|
|
325
|
+
proxyUrl: t.proxyUrl
|
|
326
326
|
}
|
|
327
327
|
);
|
|
328
328
|
})
|
|
@@ -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: C.value,
|
|
359
|
+
"onUpdate:selected": e[3] || (e[3] = (y) => C.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", {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ServerState } from '#legacy';
|
|
2
|
+
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/types';
|
|
2
3
|
/**
|
|
3
4
|
* Get the URL from the server state.
|
|
4
5
|
*/
|
|
5
|
-
export declare function getUrlFromServerState(state: ServerState): {
|
|
6
|
+
export declare function getUrlFromServerState(state: ServerState, server?: OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject): {
|
|
6
7
|
originalUrl: string | undefined;
|
|
7
8
|
modifiedUrl: string | undefined;
|
|
8
9
|
};
|
|
@@ -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;
|
|
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;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3D;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,WAAW,EAClB,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY;;;EAkC3D"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { replaceVariables as
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
(
|
|
6
|
-
const
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { replaceVariables as h, REGEX as E } from "@scalar/oas-utils/helpers";
|
|
2
|
+
function y(n, U) {
|
|
3
|
+
var l, p;
|
|
4
|
+
const o = U ?? ((l = n == null ? void 0 : n.servers) == null ? void 0 : l[n.selectedServer ?? 0]);
|
|
5
|
+
(p = o == null ? void 0 : o.url) != null && p.endsWith("/") && (o.url = o.url.slice(0, -1));
|
|
6
|
+
const _ = o == null ? void 0 : o.url, r = typeof (o == null ? void 0 : o.url) == "string" ? h(o == null ? void 0 : o.url, n.variables) : o == null ? void 0 : o.url, i = r == null ? void 0 : r.match(E.PATH), b = (i == null ? void 0 : i.reduce((u, m) => {
|
|
7
|
+
var g;
|
|
8
|
+
const f = m.replace(/{|}/g, ""), a = (g = n.variables) == null ? void 0 : g[f];
|
|
9
|
+
return u == null ? void 0 : u.replace(
|
|
10
|
+
m,
|
|
11
|
+
a || `__${f.toUpperCase()}__`
|
|
12
12
|
);
|
|
13
|
-
},
|
|
14
|
-
return { originalUrl:
|
|
13
|
+
}, r)) ?? r;
|
|
14
|
+
return { originalUrl: _, modifiedUrl: b };
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
y as getUrlFromServerState
|
|
18
18
|
};
|
|
@@ -52,6 +52,17 @@ export declare const useOpenApiStore: () => {
|
|
|
52
52
|
summary?: string | undefined;
|
|
53
53
|
tags?: string[] | undefined;
|
|
54
54
|
deprecated?: boolean | undefined;
|
|
55
|
+
servers?: ({
|
|
56
|
+
url?: string | undefined;
|
|
57
|
+
description?: string | undefined;
|
|
58
|
+
variables?: {
|
|
59
|
+
[variable: string]: OpenAPIV3.ServerVariableObject;
|
|
60
|
+
} | undefined;
|
|
61
|
+
} | {
|
|
62
|
+
url?: string | undefined;
|
|
63
|
+
description?: string | undefined;
|
|
64
|
+
variables?: Record<string, OpenAPIV3_1.ServerVariableObject> | undefined;
|
|
65
|
+
})[] | undefined;
|
|
55
66
|
'x-custom-examples'?: {
|
|
56
67
|
lang: string;
|
|
57
68
|
label: string;
|
|
@@ -68,6 +79,17 @@ export declare const useOpenApiStore: () => {
|
|
|
68
79
|
source: string;
|
|
69
80
|
}[] | undefined;
|
|
70
81
|
} | undefined;
|
|
82
|
+
servers?: ({
|
|
83
|
+
url?: string | undefined;
|
|
84
|
+
description?: string | undefined;
|
|
85
|
+
variables?: {
|
|
86
|
+
[variable: string]: OpenAPIV3.ServerVariableObject;
|
|
87
|
+
} | undefined;
|
|
88
|
+
} | {
|
|
89
|
+
url?: string | undefined;
|
|
90
|
+
description?: string | undefined;
|
|
91
|
+
variables?: Record<string, OpenAPIV3_1.ServerVariableObject> | undefined;
|
|
92
|
+
})[] | undefined;
|
|
71
93
|
pathParameters?: {
|
|
72
94
|
name: string;
|
|
73
95
|
in?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOpenApiStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useOpenApiStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAGhE,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACxC,cAAc,EACV,SAAS,CAAC,yBAAyB,EAAE,GACrC,WAAW,CAAC,yBAAyB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,uBAAuB,QAAO,YAGzC,CAAA;AAoBF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useOpenApiStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useOpenApiStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAGhE,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACxC,cAAc,EACV,SAAS,CAAC,yBAAyB,EAAE,GACrC,WAAW,CAAC,yBAAyB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,uBAAuB,QAAO,YAGzC,CAAA;AAoBF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAKy9L,UAAW,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAhCnhM,SAAS,CAAC,yBAAyB,EAAE,GACrC,WAAW,CAAC,yBAAyB,EAAE;;iCAUT,oBAAoB,GAAG,SAAS;2CAQ/C,WAAW,CAAC,yBAAyB,EAAE,GAAG,SAAS;CAYtE,CAAA"}
|