@scalar/api-reference 1.24.20 → 1.24.23
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 +48 -0
- package/dist/browser/standalone.js +22673 -23143
- 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/ApiClientModal.vue3.js +5 -0
- 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 +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +123 -155
- 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 -3
- 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 +72 -93
- 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/Schema/Schema.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
- 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/components/api-client-bus.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts +40 -0
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/BaseUrl.vue.js +97 -0
- package/dist/features/BaseUrl/BaseUrl.vue2.js +4 -0
- package/dist/features/BaseUrl/ServerForm.vue.d.ts +41 -0
- package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerForm.vue.js +7 -0
- package/dist/features/BaseUrl/ServerForm.vue2.js +66 -0
- package/dist/{components/Content/BaseUrl/ServerItem.vue.d.ts → features/BaseUrl/ServerUrl.vue.d.ts} +6 -6
- package/dist/features/BaseUrl/ServerUrl.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerUrl.vue.js +8 -0
- package/dist/features/BaseUrl/ServerUrl.vue2.js +29 -0
- package/dist/{components/ApiClientModalOld.vue.d.ts → features/BaseUrl/ServerUrlSelect.vue.d.ts} +9 -15
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +7 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +56 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts +23 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue.js +7 -0
- package/dist/features/BaseUrl/ServerVariablesForm.vue2.js +53 -0
- package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue.d.ts → features/BaseUrl/ServerVariablesSelect.vue.d.ts} +1 -1
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +7 -0
- package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue2.js → features/BaseUrl/ServerVariablesSelect.vue2.js} +1 -1
- package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts → features/BaseUrl/ServerVariablesTextbox.vue.d.ts} +1 -1
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts.map +1 -0
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.js +7 -0
- package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue2.js → features/BaseUrl/ServerVariablesTextbox.vue2.js} +6 -6
- package/dist/features/BaseUrl/index.d.ts +3 -0
- package/dist/features/BaseUrl/index.d.ts.map +1 -0
- package/dist/features/BaseUrl/types.d.ts +10 -0
- package/dist/features/BaseUrl/types.d.ts.map +1 -0
- package/dist/features/BaseUrl/utils/getServers.d.ts +15 -0
- package/dist/features/BaseUrl/utils/getServers.d.ts.map +1 -0
- package/dist/features/BaseUrl/utils/getServers.js +29 -0
- package/dist/features/BaseUrl/utils/index.d.ts +2 -0
- package/dist/features/BaseUrl/utils/index.d.ts.map +1 -0
- package/dist/helpers/createEmptySpecification.d.ts +1 -1
- package/dist/helpers/createEmptySpecification.d.ts.map +1 -1
- package/dist/helpers/createEmptySpecification.js +5 -4
- 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/getModels.d.ts +1 -1
- 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 +9 -9
- 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/{components/Content/BaseUrl/ServerVariables.vue.d.ts → legacy/components/SecurityScheme.vue.d.ts} +6 -4
- 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 +8 -11
- package/dist/types.d.ts.map +1 -1
- package/package.json +16 -15
- package/dist/components/ApiClientModal.vue2.js +0 -4
- 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/BaseUrl/BaseUrl.vue.d.ts +0 -3
- package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/BaseUrl.vue.js +0 -7
- package/dist/components/Content/BaseUrl/BaseUrl.vue2.js +0 -90
- package/dist/components/Content/BaseUrl/ServerItem.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerItem.vue.js +0 -8
- package/dist/components/Content/BaseUrl/ServerItem.vue2.js +0 -35
- package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.js +0 -7
- package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.js +0 -7
- package/dist/components/Content/BaseUrl/ServerVariables.vue.d.ts.map +0 -1
- package/dist/components/Content/BaseUrl/ServerVariables.vue.js +0 -7
- package/dist/components/Content/BaseUrl/ServerVariables.vue2.js +0 -47
- package/dist/components/Content/BaseUrl/index.d.ts +0 -2
- package/dist/components/Content/BaseUrl/index.d.ts.map +0 -1
- 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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent as v, computed as s, openBlock as r, createElementBlock as f, createVNode as i, unref as l, withCtx as u, normalizeClass as g, createElementVNode as h, renderSlot as S, createBlock as _, createCommentVNode as V } from "vue";
|
|
2
|
+
import { ScalarListbox as C, ScalarButton as k, ScalarIcon as x } from "@scalar/components";
|
|
3
|
+
const B = { class: "w-full" }, N = /* @__PURE__ */ v({
|
|
4
|
+
__name: "ServerUrlSelect",
|
|
5
|
+
props: {
|
|
6
|
+
options: {},
|
|
7
|
+
value: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["change"],
|
|
10
|
+
setup(c, { emit: d }) {
|
|
11
|
+
const n = c, m = d, o = s(
|
|
12
|
+
() => n.options.map((e, t) => ({
|
|
13
|
+
id: t.toString(),
|
|
14
|
+
label: e.url ?? ""
|
|
15
|
+
}))
|
|
16
|
+
), a = s({
|
|
17
|
+
get: () => {
|
|
18
|
+
var e;
|
|
19
|
+
return (e = o.value) == null ? void 0 : e.find((t) => t.id === n.value.toString());
|
|
20
|
+
},
|
|
21
|
+
set: (e) => m("change", (e == null ? void 0 : e.id) ?? "")
|
|
22
|
+
});
|
|
23
|
+
return (e, t) => (r(), f("div", B, [
|
|
24
|
+
i(l(C), {
|
|
25
|
+
modelValue: a.value,
|
|
26
|
+
"onUpdate:modelValue": t[0] || (t[0] = (p) => a.value = p),
|
|
27
|
+
options: o.value,
|
|
28
|
+
resize: ""
|
|
29
|
+
}, {
|
|
30
|
+
default: u(() => [
|
|
31
|
+
i(l(k), {
|
|
32
|
+
class: g(["url-select", { "pointer-events-none": o.value.length <= 1 }]),
|
|
33
|
+
fullWidth: "",
|
|
34
|
+
variant: "ghost"
|
|
35
|
+
}, {
|
|
36
|
+
default: u(() => [
|
|
37
|
+
h("span", null, [
|
|
38
|
+
S(e.$slots, "default", {}, void 0, !0)
|
|
39
|
+
]),
|
|
40
|
+
o.value.length > 1 ? (r(), _(l(x), {
|
|
41
|
+
key: 0,
|
|
42
|
+
icon: "ChevronDown",
|
|
43
|
+
size: "xs"
|
|
44
|
+
})) : V("", !0)
|
|
45
|
+
]),
|
|
46
|
+
_: 3
|
|
47
|
+
}, 8, ["class"])
|
|
48
|
+
]),
|
|
49
|
+
_: 3
|
|
50
|
+
}, 8, ["modelValue", "options"])
|
|
51
|
+
]));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
N as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ServerVariableValues, ServerVariables } from './types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
|
+
variables?: ServerVariables | undefined;
|
|
4
|
+
values?: ServerVariableValues | undefined;
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:variable": (name: string, value: string) => void;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
8
|
+
variables?: ServerVariables | undefined;
|
|
9
|
+
values?: ServerVariableValues | undefined;
|
|
10
|
+
}>>> & {
|
|
11
|
+
"onUpdate:variable"?: ((name: string, value: string) => any) | undefined;
|
|
12
|
+
}, {}, {}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToOption<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ServerVariablesForm.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerVariablesForm.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesForm.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;;;;;;;;;;;;AAmIpE,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as h, openBlock as t, createElementBlock as o, Fragment as k, renderList as y, createElementVNode as m, toDisplayString as V, createBlock as p, createCommentVNode as C } from "vue";
|
|
2
|
+
import S from "./ServerVariablesSelect.vue.js";
|
|
3
|
+
import _ from "./ServerVariablesTextbox.vue.js";
|
|
4
|
+
const B = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "variable-container"
|
|
7
|
+
}, j = ["for"], O = /* @__PURE__ */ h({
|
|
8
|
+
__name: "ServerVariablesForm",
|
|
9
|
+
props: {
|
|
10
|
+
variables: {},
|
|
11
|
+
values: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:variable"],
|
|
14
|
+
setup(d, { emit: f }) {
|
|
15
|
+
const i = d, g = f;
|
|
16
|
+
function n(a, r) {
|
|
17
|
+
g("update:variable", a, r);
|
|
18
|
+
}
|
|
19
|
+
const s = (a) => {
|
|
20
|
+
var r, e;
|
|
21
|
+
return (((r = i.values) == null ? void 0 : r[a]) ?? ((e = i.variables) == null ? void 0 : e[a].default) ?? "").toString();
|
|
22
|
+
};
|
|
23
|
+
return (a, r) => a.variables && Object.keys(a.variables ?? {}).length ? (t(), o("div", B, [
|
|
24
|
+
(t(!0), o(k, null, y(Object.keys(a.variables), (e) => {
|
|
25
|
+
var u, v, b, c;
|
|
26
|
+
return t(), o("div", {
|
|
27
|
+
key: e,
|
|
28
|
+
class: "variable-container-item"
|
|
29
|
+
}, [
|
|
30
|
+
m("label", {
|
|
31
|
+
class: "variable-label",
|
|
32
|
+
for: `variable-${e}`
|
|
33
|
+
}, [
|
|
34
|
+
m("code", null, V(e), 1)
|
|
35
|
+
], 8, j),
|
|
36
|
+
(v = (u = a.variables) == null ? void 0 : u[e].enum) != null && v.length ? (t(), p(S, {
|
|
37
|
+
key: 0,
|
|
38
|
+
enum: ((c = (b = a.variables[e]) == null ? void 0 : b.enum) == null ? void 0 : c.map((l) => `${l}`)) ?? [],
|
|
39
|
+
value: s(e),
|
|
40
|
+
onChange: (l) => n(e, l)
|
|
41
|
+
}, null, 8, ["enum", "value", "onChange"])) : (t(), p(_, {
|
|
42
|
+
key: 1,
|
|
43
|
+
value: s(e),
|
|
44
|
+
onChange: (l) => n(e, l)
|
|
45
|
+
}, null, 8, ["value", "onChange"]))
|
|
46
|
+
]);
|
|
47
|
+
}), 128))
|
|
48
|
+
])) : C("", !0);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
O as default
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesSelect.vue"],"names":[],"mappings":";;;;;;;;;;;AA6LA,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as p, computed as i, openBlock as v, createElementBlock as f, createVNode as t, unref as a, withCtx as r, createElementVNode as _, toDisplayString as h } from "vue";
|
|
2
2
|
import { ScalarListbox as S, ScalarButton as V, ScalarIcon as g } from "@scalar/components";
|
|
3
3
|
const b = { class: "w-full" }, B = /* @__PURE__ */ p({
|
|
4
|
-
__name: "
|
|
4
|
+
__name: "ServerVariablesSelect",
|
|
5
5
|
props: {
|
|
6
6
|
enum: {},
|
|
7
7
|
value: {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerVariablesTextbox.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesTextbox.vue"],"names":[],"mappings":";;;;;;;;;AAwGA,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const x = /* @__PURE__ */
|
|
3
|
-
__name: "
|
|
1
|
+
import { defineComponent as p, computed as r, withDirectives as u, openBlock as m, createElementBlock as i, vModelText as v } from "vue";
|
|
2
|
+
const x = /* @__PURE__ */ p({
|
|
3
|
+
__name: "ServerVariablesTextbox",
|
|
4
4
|
props: {
|
|
5
5
|
value: {}
|
|
6
6
|
},
|
|
7
7
|
emits: ["change"],
|
|
8
8
|
setup(l, { emit: a }) {
|
|
9
|
-
const n = l,
|
|
9
|
+
const n = l, s = a, e = r({
|
|
10
10
|
get: () => n.value,
|
|
11
|
-
set: (t) =>
|
|
11
|
+
set: (t) => s("change", t)
|
|
12
12
|
});
|
|
13
13
|
return (t, o) => u((m(), i("input", {
|
|
14
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
14
|
+
"onUpdate:modelValue": o[0] || (o[0] = (c) => e.value = c),
|
|
15
15
|
autocomplete: "off",
|
|
16
16
|
class: "variable-textbox",
|
|
17
17
|
placeholder: "value",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA;AAElD,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
|
|
2
|
+
export type Server = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject;
|
|
3
|
+
export type ServerVariables = {
|
|
4
|
+
[variable: string]: ServerVariable;
|
|
5
|
+
};
|
|
6
|
+
export type ServerVariableValues = {
|
|
7
|
+
[variable: string]: string;
|
|
8
|
+
};
|
|
9
|
+
export type ServerVariable = OpenAPIV3.ServerVariableObject | OpenAPIV3_1.ServerVariableObject;
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;AAEtE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,cAAc,GACtB,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Spec } from '@scalar/oas-utils';
|
|
2
|
+
import type { Server } from '../types';
|
|
3
|
+
export type DefaultServerUrlOption = {
|
|
4
|
+
/**
|
|
5
|
+
* Sometimes you can’t add an URL to your OpenAPI document, so you can provide a default one here.
|
|
6
|
+
*/
|
|
7
|
+
defaultServerUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Provide a specification and get the servers from it.
|
|
11
|
+
* If no servers are found, it will default to a specified URL or the current URL.
|
|
12
|
+
* Relative paths will be prepended with the default server URL or the current URL.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getServers(specification: Spec | undefined, options?: DefaultServerUrlOption): Server[];
|
|
15
|
+
//# sourceMappingURL=getServers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getServers.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/getServers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,sBAAsB,YA6DjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { findVariables as v, concatenateUrlAndPath as w } from "@scalar/oas-utils/helpers";
|
|
2
|
+
function S(r, l) {
|
|
3
|
+
var h;
|
|
4
|
+
let e = [];
|
|
5
|
+
return r != null && r.servers && (r == null ? void 0 : r.servers.length) > 0 ? e = r.servers : r != null && r.host ? e = [
|
|
6
|
+
{
|
|
7
|
+
url: `${((h = r.schemes) == null ? void 0 : h[0]) ?? "http"}://${r.host}${(r == null ? void 0 : r.basePath) ?? ""}`
|
|
8
|
+
}
|
|
9
|
+
] : e = [
|
|
10
|
+
{
|
|
11
|
+
url: l != null && l.defaultServerUrl ? l == null ? void 0 : l.defaultServerUrl : typeof window < "u" ? window.location.origin : "/"
|
|
12
|
+
}
|
|
13
|
+
], (l != null && l.defaultServerUrl || typeof window < "u") && (e = e.map((d) => b(d, l))), e.map((d) => {
|
|
14
|
+
const a = d.variables ?? {};
|
|
15
|
+
return v(d.url ?? "").filter((u) => !a[u]).forEach((u) => {
|
|
16
|
+
d.variables === void 0 && (d.variables = {}), d.variables[u] = {};
|
|
17
|
+
}), d;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function b(r, l) {
|
|
21
|
+
var e;
|
|
22
|
+
return (e = r.url) != null && e.match(/^(?!(https?|file):\/\/|{).+/) && (r.url = w(
|
|
23
|
+
l != null && l.defaultServerUrl ? l == null ? void 0 : l.defaultServerUrl : typeof window < "u" ? window.location.origin : "",
|
|
24
|
+
r.url
|
|
25
|
+
)), r;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
S as getServers
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -3,5 +3,5 @@ import type { Spec } from '@scalar/oas-utils';
|
|
|
3
3
|
* Creates an empty specification object.
|
|
4
4
|
* The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
|
|
5
5
|
*/
|
|
6
|
-
export declare function createEmptySpecification(): Spec;
|
|
6
|
+
export declare function createEmptySpecification(partialSpecification?: Partial<Spec>): Spec;
|
|
7
7
|
//# sourceMappingURL=createEmptySpecification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAI7C;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,QAsB5E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { deepMerge as r } from "./deepMerge.js";
|
|
2
|
+
function i(e) {
|
|
3
|
+
return r(e ?? {}, {
|
|
3
4
|
info: {
|
|
4
5
|
title: "",
|
|
5
6
|
description: "",
|
|
@@ -19,8 +20,8 @@ function e() {
|
|
|
19
20
|
},
|
|
20
21
|
servers: [],
|
|
21
22
|
tags: []
|
|
22
|
-
};
|
|
23
|
+
});
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
i as createEmptySpecification
|
|
26
27
|
};
|
|
@@ -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
|
};
|
|
@@ -3,5 +3,5 @@ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns all models from the specification, no matter if it’s Swagger 2.0 or OpenAPI 3.x.
|
|
5
5
|
*/
|
|
6
|
-
export declare function getModels(spec?: Spec): Record<string, OpenAPIV3_1.SchemaObject> |
|
|
6
|
+
export declare function getModels(spec?: Spec): OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3_1.SchemaObject> | Record<string, OpenAPIV3.SchemaObject>;
|
|
7
7
|
//# sourceMappingURL=getModels.d.ts.map
|
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
|
};
|