@scalar/api-reference 1.24.21 → 1.24.24
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 +41 -0
- package/dist/browser/standalone.js +21905 -22407
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/components/ApiClientModal.vue.js +19 -18
- package/dist/components/ApiReference.vue.js +14 -14
- package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +130 -151
- 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 -18
- package/dist/components/Content/Content.vue.d.ts +3 -0
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +29 -27
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
- package/dist/components/Content/Lazy/Loading.vue.js +1 -1
- package/dist/components/Content/Operation/CustomRequestExamples.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/CustomRequestExamples.vue.js +1 -1
- package/dist/components/Content/Operation/CustomRequestExamples.vue2.js +19 -19
- package/dist/components/Content/Operation/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/ExampleRequest.vue.js +2 -2
- package/dist/components/Content/Operation/ExampleRequest.vue2.js +63 -59
- package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue.js +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue2.js +26 -26
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue2.js +18 -36
- package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
- package/dist/components/Content/Tag/Endpoints.vue2.js +23 -23
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +42 -0
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -0
- package/dist/components/HttpMethod/HttpMethod.vue.js +28 -0
- package/dist/components/HttpMethod/HttpMethod.vue2.js +4 -0
- package/dist/components/HttpMethod/constants.d.ts +9 -0
- package/dist/components/HttpMethod/constants.d.ts.map +1 -0
- package/dist/components/HttpMethod/constants.js +36 -0
- package/dist/components/HttpMethod/index.d.ts +2 -0
- package/dist/components/HttpMethod/index.d.ts.map +1 -0
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +4 -0
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +1 -0
- package/dist/components/HttpMethod/utils/isRequestMethod.js +7 -0
- package/dist/components/Sidebar/SidebarHttpBadge.vue.js +1 -1
- package/dist/components/Sidebar/SidebarHttpBadge.vue2.js +6 -6
- package/dist/components/api-client-bus.d.ts +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts +9 -0
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +43 -33
- package/dist/helpers/getApiClientRequest.d.ts +1 -1
- package/dist/helpers/getApiClientRequest.d.ts.map +1 -1
- package/dist/helpers/getApiClientRequest.js +12 -11
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/openClientFor.js +10 -7
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +33 -31
- package/dist/hooks/useReactiveSpec.d.ts +1 -1
- package/dist/hooks/useSidebar.js +18 -17
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -102
- package/dist/legacy/components/CardForm.vue.d.ts +10 -0
- package/dist/legacy/components/CardForm.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardForm.vue.js +13 -0
- package/dist/legacy/components/CardFormButton.vue.d.ts +12 -0
- package/dist/legacy/components/CardFormButton.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormButton.vue.js +7 -0
- package/dist/legacy/components/CardFormButton.vue2.js +18 -0
- package/dist/legacy/components/CardFormGroup.vue.d.ts +10 -0
- package/dist/legacy/components/CardFormGroup.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormGroup.vue.js +13 -0
- package/dist/legacy/components/CardFormRows.vue.d.ts +10 -0
- package/dist/legacy/components/CardFormRows.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormRows.vue.js +13 -0
- package/dist/legacy/components/CardFormTextInput.vue.d.ts +25 -0
- package/dist/legacy/components/CardFormTextInput.vue.d.ts.map +1 -0
- package/dist/legacy/components/CardFormTextInput.vue.js +7 -0
- package/dist/legacy/components/CardFormTextInput.vue2.js +37 -0
- package/dist/legacy/components/SecurityScheme.vue.d.ts +19 -0
- package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -0
- package/dist/legacy/components/SecurityScheme.vue.js +7 -0
- package/dist/legacy/components/SecurityScheme.vue2.js +364 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts +26 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts.map +1 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue.js +7 -0
- package/dist/legacy/components/SecuritySchemeScopes.vue2.js +91 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts +25 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue.js +7 -0
- package/dist/legacy/components/SecuritySchemeSelector.vue2.js +64 -0
- package/dist/legacy/fixtures/httpHeaders.d.ts +6 -0
- package/dist/legacy/fixtures/httpHeaders.d.ts.map +1 -0
- package/dist/legacy/fixtures/httpRequestMethods.d.ts +10 -0
- package/dist/legacy/fixtures/httpRequestMethods.d.ts.map +1 -0
- package/dist/legacy/fixtures/httpRequestMethods.js +18 -0
- package/dist/legacy/fixtures/index.d.ts +3 -0
- package/dist/legacy/fixtures/index.d.ts.map +1 -0
- package/dist/legacy/helpers/createPlaceholderRequest.d.ts +6 -0
- package/dist/legacy/helpers/createPlaceholderRequest.d.ts.map +1 -0
- package/dist/legacy/helpers/createPlaceholderRequest.js +14 -0
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts +5 -0
- package/dist/legacy/helpers/encodeStringAsBase64.d.ts.map +1 -0
- package/dist/legacy/helpers/encodeStringAsBase64.js +6 -0
- package/dist/legacy/helpers/getRequestFromAuthentication.d.ts +10 -0
- package/dist/legacy/helpers/getRequestFromAuthentication.d.ts.map +1 -0
- package/dist/legacy/helpers/getRequestFromAuthentication.js +83 -0
- package/dist/legacy/helpers/getUrlFromServerState.d.ts +6 -0
- package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -0
- package/dist/legacy/helpers/getUrlFromServerState.js +9 -0
- package/dist/legacy/helpers/humanDiff.d.ts +5 -0
- package/dist/legacy/helpers/humanDiff.d.ts.map +1 -0
- package/dist/legacy/helpers/index.d.ts +12 -0
- package/dist/legacy/helpers/index.d.ts.map +1 -0
- package/dist/legacy/helpers/mapFromArray.d.ts +5 -0
- package/dist/legacy/helpers/mapFromArray.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizeHeaders.d.ts +9 -0
- package/dist/legacy/helpers/normalizeHeaders.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizePath.d.ts +5 -0
- package/dist/legacy/helpers/normalizePath.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts +6 -0
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +1 -0
- package/dist/legacy/helpers/normalizeRequestMethod.js +14 -0
- package/dist/legacy/helpers/normalizeUrl.d.ts +5 -0
- package/dist/legacy/helpers/normalizeUrl.d.ts.map +1 -0
- package/dist/legacy/helpers/prepareClientRequestConfig.d.ts +24 -0
- package/dist/legacy/helpers/prepareClientRequestConfig.d.ts.map +1 -0
- package/dist/legacy/index.d.ts +5 -0
- package/dist/legacy/index.d.ts.map +1 -0
- package/dist/legacy/stores/index.d.ts +6 -0
- package/dist/legacy/stores/index.d.ts.map +1 -0
- package/dist/legacy/stores/useApiClientStore.d.ts +18 -0
- package/dist/legacy/stores/useApiClientStore.d.ts.map +1 -0
- package/dist/legacy/stores/useApiClientStore.js +32 -0
- package/dist/legacy/stores/useAuthenticationStore.d.ts +59 -0
- package/dist/legacy/stores/useAuthenticationStore.d.ts.map +1 -0
- package/dist/legacy/stores/useAuthenticationStore.js +36 -0
- package/dist/legacy/stores/useOpenApiStore.d.ts +95 -0
- package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -0
- package/dist/legacy/stores/useOpenApiStore.js +23 -0
- package/dist/legacy/stores/useRequestStore.d.ts +58 -0
- package/dist/legacy/stores/useRequestStore.d.ts.map +1 -0
- package/dist/legacy/stores/useRequestStore.js +33 -0
- package/dist/legacy/stores/useServerStore.d.ts +18 -0
- package/dist/legacy/stores/useServerStore.d.ts.map +1 -0
- package/dist/legacy/stores/useServerStore.js +18 -0
- package/dist/legacy/types.d.ts +117 -0
- package/dist/legacy/types.d.ts.map +1 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +7 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +14 -13
- package/dist/components/ApiClientModalOld.vue.d.ts +0 -36
- package/dist/components/ApiClientModalOld.vue.d.ts.map +0 -1
- package/dist/components/ApiClientModalOld.vue.js +0 -7
- package/dist/components/ApiClientModalOld.vue2.js +0 -88
- package/dist/components/Content/Schema/SchemaProperty.spec.d.ts +0 -2
- package/dist/components/Content/Schema/SchemaProperty.spec.d.ts.map +0 -1
- package/dist/features.d.ts +0 -8
- package/dist/features.d.ts.map +0 -1
- package/dist/features.js +0 -5
- package/dist/standalone.spec.d.ts +0 -2
- package/dist/standalone.spec.d.ts.map +0 -1
|
@@ -1,87 +1,97 @@
|
|
|
1
1
|
import { defineComponent as b, ref as S, watch as c, openBlock as U, createBlock as g, unref as u } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import j from "./ServerForm.vue.js";
|
|
3
|
+
import { getServers as E } from "./utils/getServers.js";
|
|
4
|
+
import { createEmptySpecification as O } from "../../helpers/createEmptySpecification.js";
|
|
5
|
+
import { useServerStore as _ } from "../../legacy/stores/useServerStore.js";
|
|
6
|
+
const w = /* @__PURE__ */ b({
|
|
6
7
|
__name: "BaseUrl",
|
|
7
8
|
props: {
|
|
8
9
|
specification: {},
|
|
9
|
-
defaultServerUrl: {}
|
|
10
|
+
defaultServerUrl: {},
|
|
11
|
+
servers: {}
|
|
10
12
|
},
|
|
11
13
|
setup(f) {
|
|
12
|
-
const
|
|
14
|
+
const a = f, { server: i, setServer: o } = _(), s = S(0);
|
|
13
15
|
c(
|
|
14
|
-
|
|
16
|
+
s,
|
|
15
17
|
() => o({
|
|
16
|
-
selectedServer:
|
|
18
|
+
selectedServer: s.value
|
|
17
19
|
}),
|
|
18
20
|
{
|
|
19
21
|
immediate: !0
|
|
20
22
|
}
|
|
21
23
|
), c(
|
|
22
|
-
() =>
|
|
24
|
+
() => a.specification,
|
|
23
25
|
() => {
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
|
|
26
|
+
var r;
|
|
27
|
+
const t = (
|
|
28
|
+
// Use the specification
|
|
29
|
+
a.servers === void 0 ? a.specification : (
|
|
30
|
+
// Or create an empty one with the specified servers list
|
|
31
|
+
O({
|
|
32
|
+
servers: a.servers
|
|
33
|
+
})
|
|
34
|
+
)
|
|
35
|
+
), e = E(t, {
|
|
36
|
+
defaultServerUrl: a.defaultServerUrl
|
|
27
37
|
});
|
|
28
38
|
o({
|
|
29
|
-
servers:
|
|
39
|
+
servers: e,
|
|
30
40
|
variables: {
|
|
31
41
|
// Set the initial values for the variables
|
|
32
42
|
...m(
|
|
33
|
-
((
|
|
43
|
+
((r = e[s.value]) == null ? void 0 : r.variables) ?? {}
|
|
34
44
|
),
|
|
35
45
|
// Don’t overwrite existing values, but filter out non-existing variables
|
|
36
46
|
...p(
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
i.variables,
|
|
48
|
+
e[s.value]
|
|
39
49
|
)
|
|
40
50
|
}
|
|
41
51
|
});
|
|
42
52
|
},
|
|
43
53
|
{ deep: !0, immediate: !0 }
|
|
44
54
|
);
|
|
45
|
-
function m(
|
|
55
|
+
function m(t) {
|
|
46
56
|
return Object.fromEntries(
|
|
47
|
-
Object.entries(
|
|
57
|
+
Object.entries(t ?? {}).map(([e, r]) => {
|
|
48
58
|
var n, l, v;
|
|
49
59
|
return [
|
|
50
60
|
e,
|
|
51
61
|
// 1) Default
|
|
52
|
-
((n =
|
|
53
|
-
((v = (l =
|
|
62
|
+
((n = r.default) == null ? void 0 : n.toString()) ?? // 2) First enum value
|
|
63
|
+
((v = (l = r.enum) == null ? void 0 : l[0]) == null ? void 0 : v.toString()) ?? // 3) Empty string
|
|
54
64
|
""
|
|
55
65
|
];
|
|
56
66
|
})
|
|
57
67
|
);
|
|
58
68
|
}
|
|
59
|
-
function p(
|
|
69
|
+
function p(t, e) {
|
|
60
70
|
return Object.fromEntries(
|
|
61
|
-
Object.entries(
|
|
62
|
-
([
|
|
71
|
+
Object.entries(t).filter(
|
|
72
|
+
([r]) => r in (e.variables ?? {})
|
|
63
73
|
)
|
|
64
74
|
);
|
|
65
75
|
}
|
|
66
|
-
function d(
|
|
76
|
+
function d(t, e) {
|
|
67
77
|
o({
|
|
68
78
|
variables: {
|
|
69
|
-
...
|
|
70
|
-
[
|
|
79
|
+
...i.variables,
|
|
80
|
+
[t]: e
|
|
71
81
|
}
|
|
72
82
|
});
|
|
73
83
|
}
|
|
74
|
-
return (
|
|
75
|
-
selected:
|
|
76
|
-
servers: u(
|
|
77
|
-
variables: u(
|
|
78
|
-
"onUpdate:selected": e[0] || (e[0] = (
|
|
79
|
-
|
|
84
|
+
return (t, e) => (U(), g(j, {
|
|
85
|
+
selected: s.value,
|
|
86
|
+
servers: u(i).servers,
|
|
87
|
+
variables: u(i).variables,
|
|
88
|
+
"onUpdate:selected": e[0] || (e[0] = (r) => {
|
|
89
|
+
s.value = r;
|
|
80
90
|
}),
|
|
81
91
|
"onUpdate:variable": d
|
|
82
92
|
}, null, 8, ["selected", "servers", "variables"]));
|
|
83
93
|
}
|
|
84
94
|
});
|
|
85
95
|
export {
|
|
86
|
-
|
|
96
|
+
w as default
|
|
87
97
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClientRequestConfig, type ServerState } from '
|
|
1
|
+
import { type ClientRequestConfig, type ServerState } from '#legacy';
|
|
2
2
|
import type { AuthenticationState, TransformedOperation } from '@scalar/oas-utils';
|
|
3
3
|
import type { OpenAPIV3 } from '@scalar/openapi-parser';
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getApiClientRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/getApiClientRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAGjB,MAAM,
|
|
1
|
+
{"version":3,"file":"getApiClientRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/getApiClientRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAGjB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,mBAAmB,CAAA;AAK1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIvD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,cAAc,GACf,EAAE;IACD,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,EAAE,oBAAoB,CAAA;IAC/B,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAChD,cAAc,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAA;CAC9D,GAAG,mBAAmB,CAmCtB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getRequestFromOperation as m, getParametersFromOperation as c } from "@scalar/oas-utils/spec-getters";
|
|
1
|
+
import { getRequestFromOperation as n, getParametersFromOperation as d } from "@scalar/oas-utils/spec-getters";
|
|
3
2
|
import { getHarRequest as f } from "./getHarRequest.js";
|
|
4
|
-
|
|
3
|
+
import { getRequestFromAuthentication as c } from "../legacy/helpers/getRequestFromAuthentication.js";
|
|
4
|
+
import { getUrlFromServerState as s } from "../legacy/helpers/getUrlFromServerState.js";
|
|
5
|
+
function O({
|
|
5
6
|
serverState: t,
|
|
6
7
|
authenticationState: o,
|
|
7
8
|
operation: e,
|
|
@@ -12,23 +13,23 @@ function F({
|
|
|
12
13
|
{
|
|
13
14
|
url: s(t)
|
|
14
15
|
},
|
|
15
|
-
|
|
16
|
+
n(e, { requiredOnly: !1 }),
|
|
16
17
|
// Only generate authentication parameters if an authentication state is passed.
|
|
17
|
-
o ?
|
|
18
|
+
o ? c(
|
|
18
19
|
o,
|
|
19
20
|
((u = e.information) == null ? void 0 : u.security) ?? l ?? []
|
|
20
21
|
) : {}
|
|
21
|
-
),
|
|
22
|
+
), p = n(e, {
|
|
22
23
|
requiredOnly: !1
|
|
23
|
-
}),
|
|
24
|
+
}), q = d(e, "path", !1);
|
|
24
25
|
return {
|
|
25
26
|
id: e.operationId,
|
|
26
27
|
name: e.name,
|
|
27
28
|
type: r.method,
|
|
28
|
-
path:
|
|
29
|
-
variables:
|
|
29
|
+
path: p.path ?? "",
|
|
30
|
+
variables: q,
|
|
30
31
|
cookies: i(r.cookies),
|
|
31
|
-
query: r.queryString.map((
|
|
32
|
+
query: r.queryString.map((m) => ({ ...m, enabled: m.required ?? !0 })),
|
|
32
33
|
headers: i(r.headers),
|
|
33
34
|
url: s(t) ?? "",
|
|
34
35
|
body: (a = r.postData) == null ? void 0 : a.text
|
|
@@ -38,5 +39,5 @@ function i(t) {
|
|
|
38
39
|
return (t ?? []).map((o) => ({ ...o, enabled: !0 }));
|
|
39
40
|
}
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
O as getApiClientRequest
|
|
42
43
|
};
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './createEmptySpecification.js';
|
|
2
2
|
export * from './deepMerge.js';
|
|
3
3
|
export * from './getApiClientRequest.js';
|
|
4
|
+
export * from './getHarRequest.js';
|
|
4
5
|
export * from './getHeadingsFromMarkdown.js';
|
|
5
6
|
export * from './getLowestHeadingLevel.js';
|
|
6
7
|
export * from './getModels.js';
|
|
@@ -19,5 +20,4 @@ export * from './scrollToId.js';
|
|
|
19
20
|
export * from './sleep.js';
|
|
20
21
|
export * from './specDownloads.js';
|
|
21
22
|
export * from './splitMarkdownInSections.js';
|
|
22
|
-
export * from './getHarRequest.js';
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getApiClientRequest as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useApiClientStore as r } from "../legacy/stores/useApiClientStore.js";
|
|
2
|
+
import { getApiClientRequest as s } from "./getApiClientRequest.js";
|
|
3
|
+
import { useServerStore as i } from "../legacy/stores/useServerStore.js";
|
|
4
|
+
import { useRequestStore as n } from "../legacy/stores/useRequestStore.js";
|
|
5
|
+
import { useOpenApiStore as u } from "../legacy/stores/useOpenApiStore.js";
|
|
6
|
+
const { server: l } = i(), { setOperation: p, setGlobalSecurity: c } = u(), { toggleApiClient: m } = r(), { setActiveRequest: S, resetActiveResponse: a } = n();
|
|
7
|
+
function C(e, o) {
|
|
8
|
+
const t = s({
|
|
6
9
|
serverState: l,
|
|
7
10
|
operation: e,
|
|
8
11
|
// Let the API client handle the authentication.
|
|
9
12
|
authenticationState: null,
|
|
10
13
|
globalSecurity: null
|
|
11
14
|
});
|
|
12
|
-
|
|
15
|
+
a(), S(t), p(e), c(o), m(t, !0);
|
|
13
16
|
}
|
|
14
17
|
export {
|
|
15
|
-
|
|
18
|
+
C as openClientFor
|
|
16
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAe7C,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,QAAQ,IAAI,CAmDd,CAAA"}
|
package/dist/helpers/parse.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { redirectToProxy as b
|
|
2
|
-
import { load as
|
|
3
|
-
import { fetchUrls as
|
|
1
|
+
import { redirectToProxy as b } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { load as j, dereference as M } from "@scalar/openapi-parser";
|
|
3
|
+
import { fetchUrls as q } from "@scalar/openapi-parser/plugins/fetch-urls";
|
|
4
4
|
import { createEmptySpecification as m } from "./createEmptySpecification.js";
|
|
5
|
-
|
|
5
|
+
import { normalizeRequestMethod as E } from "../legacy/helpers/normalizeRequestMethod.js";
|
|
6
|
+
import { validRequestMethods as k } from "../legacy/fixtures/httpRequestMethods.js";
|
|
7
|
+
const D = (p, {
|
|
6
8
|
proxy: t
|
|
7
9
|
} = {}) => new Promise(async (a, h) => {
|
|
8
10
|
var s;
|
|
@@ -11,20 +13,20 @@ const v = (p, {
|
|
|
11
13
|
return a(
|
|
12
14
|
u(m())
|
|
13
15
|
);
|
|
14
|
-
const i = performance.now(), { filesystem:
|
|
16
|
+
const i = performance.now(), { filesystem: n } = await j(p, {
|
|
15
17
|
plugins: [
|
|
16
|
-
|
|
18
|
+
q({
|
|
17
19
|
fetch: (o) => fetch(t ? b(t, o) : o)
|
|
18
20
|
})
|
|
19
21
|
]
|
|
20
|
-
}), { schema: e, errors:
|
|
21
|
-
return console.log(`dereference: ${Math.round(
|
|
22
|
+
}), { schema: e, errors: r } = await M(n), f = performance.now();
|
|
23
|
+
return console.log(`dereference: ${Math.round(f - i)} ms`), r != null && r.length && console.warn(
|
|
22
24
|
`Please open an issue on https://github.com/scalar/scalar
|
|
23
25
|
`,
|
|
24
26
|
`Scalar OpenAPI Parser Warning:
|
|
25
27
|
`,
|
|
26
|
-
|
|
27
|
-
), e === void 0 ? (h(((s =
|
|
28
|
+
r
|
|
29
|
+
), e === void 0 ? (h(((s = r == null ? void 0 : r[0]) == null ? void 0 : s.message) ?? "Failed to parse the OpenAPI file."), a(
|
|
28
30
|
u(m())
|
|
29
31
|
)) : a(u(e));
|
|
30
32
|
} catch (i) {
|
|
@@ -39,17 +41,17 @@ const v = (p, {
|
|
|
39
41
|
const a = {};
|
|
40
42
|
return Object.keys(t.webhooks ?? {}).forEach((s) => {
|
|
41
43
|
var i;
|
|
42
|
-
Object.keys(((i = t.webhooks) == null ? void 0 : i[s]) ?? {}).forEach((
|
|
43
|
-
var
|
|
44
|
-
const e = (
|
|
45
|
-
(e == null ? void 0 : e["x-internal"]) !== !0 && (a[s] === void 0 && (a[s] = {}), a[s][
|
|
44
|
+
Object.keys(((i = t.webhooks) == null ? void 0 : i[s]) ?? {}).forEach((n) => {
|
|
45
|
+
var r, f, o;
|
|
46
|
+
const e = (r = t.webhooks) == null ? void 0 : r[s][n];
|
|
47
|
+
(e == null ? void 0 : e["x-internal"]) !== !0 && (a[s] === void 0 && (a[s] = {}), a[s][n] = {
|
|
46
48
|
// Transformed data
|
|
47
|
-
httpVerb: E(
|
|
49
|
+
httpVerb: E(n),
|
|
48
50
|
path: s,
|
|
49
51
|
operationId: (e == null ? void 0 : e.operationId) || s,
|
|
50
52
|
name: (e == null ? void 0 : e.summary) || s || "",
|
|
51
53
|
description: (e == null ? void 0 : e.description) || "",
|
|
52
|
-
pathParameters: (o = (
|
|
54
|
+
pathParameters: (o = (f = t.paths) == null ? void 0 : f[s]) == null ? void 0 : o.parameters,
|
|
53
55
|
// Original webhook
|
|
54
56
|
information: {
|
|
55
57
|
...e
|
|
@@ -58,14 +60,14 @@ const v = (p, {
|
|
|
58
60
|
});
|
|
59
61
|
}), Object.keys(t.paths).forEach((s) => {
|
|
60
62
|
Object.keys(t.paths[s]).filter(
|
|
61
|
-
(
|
|
62
|
-
).forEach((
|
|
63
|
-
var
|
|
64
|
-
const e = t.paths[s][
|
|
63
|
+
(n) => k.includes(n.toUpperCase())
|
|
64
|
+
).forEach((n) => {
|
|
65
|
+
var f, o, g, w, y, x;
|
|
66
|
+
const e = t.paths[s][n];
|
|
65
67
|
if (e === void 0 || e["x-internal"] === !0)
|
|
66
68
|
return;
|
|
67
|
-
const
|
|
68
|
-
httpVerb: E(
|
|
69
|
+
const r = {
|
|
70
|
+
httpVerb: E(n),
|
|
69
71
|
path: s,
|
|
70
72
|
operationId: e.operationId || s,
|
|
71
73
|
name: e.summary || s || "",
|
|
@@ -73,33 +75,33 @@ const v = (p, {
|
|
|
73
75
|
information: {
|
|
74
76
|
...e
|
|
75
77
|
},
|
|
76
|
-
pathParameters: (o = (
|
|
78
|
+
pathParameters: (o = (f = t.paths) == null ? void 0 : f[s]) == null ? void 0 : o.parameters
|
|
77
79
|
};
|
|
78
80
|
if (!e.tags || e.tags.length === 0) {
|
|
79
81
|
(g = t.tags) != null && g.find(
|
|
80
|
-
(
|
|
82
|
+
(c) => c.name === "default"
|
|
81
83
|
) || (w = t.tags) == null || w.push({
|
|
82
84
|
name: "default",
|
|
83
85
|
description: "",
|
|
84
86
|
operations: []
|
|
85
87
|
});
|
|
86
88
|
const d = (y = t.tags) == null ? void 0 : y.findIndex(
|
|
87
|
-
(
|
|
89
|
+
(c) => c.name === "default"
|
|
88
90
|
);
|
|
89
|
-
d >= 0 && ((x = t.tags[d]) == null || x.operations.push(
|
|
91
|
+
d >= 0 && ((x = t.tags[d]) == null || x.operations.push(r));
|
|
90
92
|
} else
|
|
91
93
|
e.tags.forEach((d) => {
|
|
92
94
|
var I, O, P;
|
|
93
|
-
const
|
|
95
|
+
const c = (I = t.tags) == null ? void 0 : I.findIndex(
|
|
94
96
|
// @ts-expect-error TODO: The types are just screwed, needs refactoring
|
|
95
97
|
(R) => R.name === d
|
|
96
98
|
);
|
|
97
|
-
|
|
99
|
+
c === -1 && ((O = t.tags) == null || O.push({
|
|
98
100
|
name: d,
|
|
99
101
|
description: ""
|
|
100
102
|
}));
|
|
101
|
-
const l =
|
|
102
|
-
typeof ((P = t.tags[l]) == null ? void 0 : P.operations) > "u" && (t.tags[l].operations = []), t.tags[l].operations.push(
|
|
103
|
+
const l = c !== -1 ? c : t.tags.length - 1;
|
|
104
|
+
typeof ((P = t.tags[l]) == null ? void 0 : P.operations) > "u" && (t.tags[l].operations = []), t.tags[l].operations.push(r);
|
|
103
105
|
});
|
|
104
106
|
});
|
|
105
107
|
}), {
|
|
@@ -108,5 +110,5 @@ const v = (p, {
|
|
|
108
110
|
};
|
|
109
111
|
};
|
|
110
112
|
export {
|
|
111
|
-
|
|
113
|
+
D as parse
|
|
112
114
|
};
|
|
@@ -13,7 +13,7 @@ export declare function useReactiveSpec({ specConfig, proxy, }: {
|
|
|
13
13
|
name: string;
|
|
14
14
|
description: string;
|
|
15
15
|
operations: {
|
|
16
|
-
httpVerb: "
|
|
16
|
+
httpVerb: "GET" | "POST" | "PUT" | "HEAD" | "DELETE" | "PATCH" | "OPTIONS" | "CONNECT" | "TRACE";
|
|
17
17
|
path: string;
|
|
18
18
|
operationId?: string | undefined;
|
|
19
19
|
name?: string | undefined;
|
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useNavState as Y } from "./useNavState.js";
|
|
1
|
+
import { ssrState as Q } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { ref as g, reactive as R, computed as P, watch as L } from "vue";
|
|
3
|
+
import { useNavState as U } from "./useNavState.js";
|
|
5
4
|
import { getLowestHeadingLevel as q } from "../helpers/getLowestHeadingLevel.js";
|
|
6
5
|
import { openClientFor as W } from "../helpers/openClientFor.js";
|
|
7
|
-
import { hasModels as
|
|
6
|
+
import { hasModels as X } from "../helpers/hasModels.js";
|
|
8
7
|
import { getModels as D } from "../helpers/getModels.js";
|
|
9
|
-
import { hasWebhooks as
|
|
10
|
-
import { getHeadingsFromMarkdown as
|
|
8
|
+
import { hasWebhooks as Y } from "../helpers/hasWebhooks.js";
|
|
9
|
+
import { getHeadingsFromMarkdown as Z } from "../helpers/getHeadingsFromMarkdown.js";
|
|
10
|
+
import { useApiClientStore as _ } from "../legacy/stores/useApiClientStore.js";
|
|
11
|
+
import { useOpenApiStore as $ } from "../legacy/stores/useOpenApiStore.js";
|
|
11
12
|
const {
|
|
12
13
|
getHeadingId: F,
|
|
13
14
|
getModelId: V,
|
|
@@ -16,12 +17,12 @@ const {
|
|
|
16
17
|
getTagId: z,
|
|
17
18
|
getWebhookId: S,
|
|
18
19
|
hash: I
|
|
19
|
-
} =
|
|
20
|
+
} = U(), o = g(void 0);
|
|
20
21
|
function te(t) {
|
|
21
22
|
return o.value = t;
|
|
22
23
|
}
|
|
23
|
-
const J = g(!1), w =
|
|
24
|
-
|
|
24
|
+
const J = g(!1), w = R(
|
|
25
|
+
Q["useSidebarContent-collapsedSidebarItems"] ?? {}
|
|
25
26
|
);
|
|
26
27
|
function se(t) {
|
|
27
28
|
w[t] = !w[t];
|
|
@@ -30,7 +31,7 @@ function C(t, s) {
|
|
|
30
31
|
w[t] = s;
|
|
31
32
|
}
|
|
32
33
|
const b = g([]), ie = async (t) => {
|
|
33
|
-
const s = await
|
|
34
|
+
const s = await Z(t), l = q(s);
|
|
34
35
|
return s.filter((n) => (
|
|
35
36
|
// highest level, eg. # Introduction
|
|
36
37
|
n.depth === l || // second highest level, eg. ## Authentication
|
|
@@ -38,9 +39,9 @@ const b = g([]), ie = async (t) => {
|
|
|
38
39
|
));
|
|
39
40
|
}, K = P(() => {
|
|
40
41
|
var k, A, O, y, T, H, M, x, j, E;
|
|
41
|
-
const { state: t } =
|
|
42
|
+
const { state: t } = _(), s = {}, {
|
|
42
43
|
openApi: { globalSecurity: l }
|
|
43
|
-
} =
|
|
44
|
+
} = $(), n = [];
|
|
44
45
|
let p = null;
|
|
45
46
|
b.value.forEach((e) => {
|
|
46
47
|
var i;
|
|
@@ -96,7 +97,7 @@ const b = g([]), ie = async (t) => {
|
|
|
96
97
|
}
|
|
97
98
|
};
|
|
98
99
|
});
|
|
99
|
-
let f =
|
|
100
|
+
let f = X(o.value) && !J.value ? [
|
|
100
101
|
{
|
|
101
102
|
id: V(),
|
|
102
103
|
title: "Models",
|
|
@@ -113,7 +114,7 @@ const b = g([]), ie = async (t) => {
|
|
|
113
114
|
}
|
|
114
115
|
)
|
|
115
116
|
}
|
|
116
|
-
] : [], m =
|
|
117
|
+
] : [], m = Y(o.value) ? [
|
|
117
118
|
{
|
|
118
119
|
id: S(),
|
|
119
120
|
title: "Webhook",
|
|
@@ -170,7 +171,7 @@ const b = g([]), ie = async (t) => {
|
|
|
170
171
|
var t, s;
|
|
171
172
|
return ((s = (t = K.value) == null ? void 0 : t.titles) == null ? void 0 : s[I.value]) ?? "";
|
|
172
173
|
});
|
|
173
|
-
function
|
|
174
|
+
function be(t) {
|
|
174
175
|
return t != null && t.parsedSpec && (o.value = t.parsedSpec, L(
|
|
175
176
|
() => {
|
|
176
177
|
var s, l;
|
|
@@ -208,5 +209,5 @@ function we(t) {
|
|
|
208
209
|
};
|
|
209
210
|
}
|
|
210
211
|
export {
|
|
211
|
-
|
|
212
|
+
be as useSidebar
|
|
212
213
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { default as ApiClientModal } from './components/ApiClientModalOld.vue.js';
|
|
2
1
|
export { default as ApiReference } from './components/ApiReference.vue.js';
|
|
3
2
|
export { default as ApiReferenceLayout } from './components/ApiReferenceLayout.vue.js';
|
|
4
3
|
export { default as ModernLayout } from './components/Layouts/ModernLayout.vue.js';
|
|
@@ -16,5 +15,4 @@ export * from './stores';
|
|
|
16
15
|
export * from './helpers';
|
|
17
16
|
export * from './types';
|
|
18
17
|
export * from './hooks';
|
|
19
|
-
export { useApiClientStore } from '@scalar/api-client';
|
|
20
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|