@scalar/api-client 2.1.38 → 2.1.40
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 +25 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +105 -84
- package/dist/components/CodeInput/codeVariableWidget.d.ts +3 -0
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +51 -47
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +102 -129
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts +2 -3
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/PrefetchError.vue.js +27 -0
- package/dist/components/ImportCollection/PrefetchError.vue2.js +4 -0
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +11 -17
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +72 -29
- package/dist/components/OpenApiClientButton.vue.d.ts +4 -4
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/OpenApiClientButton.vue2.js +14 -11
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +20 -28
- package/dist/components/Sidebar/SidebarButton.vue.d.ts +5 -3
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +16 -16
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +5 -5
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +37 -37
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +23 -21
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +30 -30
- package/dist/store/environment.js +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts +1 -5
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +58 -61
- package/dist/views/Environment/Environment.vue.d.ts +1 -5
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +142 -96
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +17 -18
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +36 -34
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +25 -25
- package/dist/views/Request/libs/oauth2.d.ts +2 -2
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +45 -34
- package/package.json +7 -6
|
@@ -1,178 +1,151 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as z, ref as S, computed as i, watch as p, onMounted as B, onUnmounted as F, openBlock as c, createBlock as g, unref as r, withCtx as O, createElementVNode as t, normalizeClass as T, createElementBlock as m, Fragment as f, createVNode as a, createCommentVNode as x, toDisplayString as q, createTextVNode as w } from "vue";
|
|
2
|
+
import E from "../CommandPalette/WatchModeToggle.vue.js";
|
|
3
|
+
import W from "./ImportNowButton.vue.js";
|
|
4
|
+
import K from "./IntegrationLogo.vue.js";
|
|
5
|
+
import R from "./PrefetchError.vue.js";
|
|
6
|
+
import G from "./WorkspaceSelector.vue.js";
|
|
7
|
+
import { useUrlPrefetcher as H } from "./hooks/useUrlPrefetcher.js";
|
|
8
|
+
import { getOpenApiDocumentVersion as k } from "./utils/getOpenApiDocumentVersion.js";
|
|
9
|
+
import { isDocument as I } from "./utils/isDocument.js";
|
|
6
10
|
import { isUrl as h } from "./utils/isUrl.js";
|
|
7
|
-
import { useModal as
|
|
8
|
-
import { isLocalUrl as
|
|
9
|
-
import { normalize as
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import re from "./WorkspaceSelector.vue.js";
|
|
13
|
-
import { useWorkspace as ne } from "../../store/store.js";
|
|
14
|
-
const le = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, ie = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, ce = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ae = { class: "flex justify-center" }, de = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, me = {
|
|
11
|
+
import { useModal as J, ScalarModal as Q, ScalarIcon as X } from "@scalar/components";
|
|
12
|
+
import { isLocalUrl as Y } from "@scalar/oas-utils/helpers";
|
|
13
|
+
import { normalize as Z } from "@scalar/openapi-parser";
|
|
14
|
+
import { useWorkspace as ee } from "../../store/store.js";
|
|
15
|
+
const te = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, oe = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, se = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ne = { class: "flex justify-center" }, re = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, le = {
|
|
15
16
|
key: 0,
|
|
16
17
|
class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
|
|
17
|
-
},
|
|
18
|
-
key: 3,
|
|
19
|
-
class: "flex flex-col gap-2"
|
|
20
|
-
}, fe = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, xe = { class: "bg-b-2 h-48 border rounded custom-scroll" }, he = { class: "flex flex-col justify-center items-center pb-8" }, ve = { class: "text-center flex items-center flex-col" }, _e = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ye = {
|
|
18
|
+
}, ie = { class: "flex items-center justify-center" }, ce = { class: "flex flex-col justify-center items-center pb-8" }, ae = { class: "text-center flex items-center flex-col" }, me = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, de = {
|
|
21
19
|
href: "https://scalar.com/download",
|
|
22
20
|
target: "_blank"
|
|
23
|
-
},
|
|
21
|
+
}, Le = /* @__PURE__ */ z({
|
|
24
22
|
__name: "ImportCollectionModal",
|
|
25
23
|
props: {
|
|
26
24
|
source: {},
|
|
27
25
|
integration: {}
|
|
28
26
|
},
|
|
29
27
|
emits: ["importFinished"],
|
|
30
|
-
setup(
|
|
31
|
-
const n =
|
|
32
|
-
|
|
33
|
-
const
|
|
28
|
+
setup(A) {
|
|
29
|
+
const n = A, { activeWorkspace: L, events: U } = ee(), { prefetchResult: s, prefetchUrl: C } = H(), l = J(), d = S(!0);
|
|
30
|
+
U.hotKeys.on(() => l.hide());
|
|
31
|
+
const M = i(() => {
|
|
34
32
|
try {
|
|
35
|
-
return
|
|
36
|
-
|
|
33
|
+
return Z(
|
|
34
|
+
s.content || n.source || ""
|
|
37
35
|
);
|
|
38
36
|
} catch {
|
|
39
37
|
return;
|
|
40
38
|
}
|
|
41
|
-
}),
|
|
42
|
-
var o,
|
|
43
|
-
return (
|
|
44
|
-
}), v =
|
|
45
|
-
() =>
|
|
39
|
+
}), V = i(() => {
|
|
40
|
+
var o, e;
|
|
41
|
+
return (e = (o = M.value) == null ? void 0 : o.info) == null ? void 0 : e.title;
|
|
42
|
+
}), v = i(
|
|
43
|
+
() => k(s.content || n.source || "")
|
|
46
44
|
);
|
|
47
|
-
|
|
45
|
+
p(
|
|
48
46
|
() => n.source,
|
|
49
47
|
(o) => {
|
|
50
|
-
h(o) &&
|
|
48
|
+
h(o) && C(o, L.value.proxyUrl), o && (h(o) || I(o) && k(o)) ? l.show() : l.hide();
|
|
51
49
|
}
|
|
52
50
|
);
|
|
53
|
-
const
|
|
54
|
-
(
|
|
55
|
-
},
|
|
51
|
+
const D = i(() => !!n.source && h(n.source)), N = i(() => !!n.source && I(n.source)), P = i(() => s.url && Y(s.url)), u = (o) => {
|
|
52
|
+
document.body.classList.remove("has-no-import-url"), (D.value || N.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
53
|
+
}, $ = () => {
|
|
56
54
|
document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
|
|
57
55
|
};
|
|
58
|
-
return
|
|
56
|
+
return p(
|
|
59
57
|
() => l.open,
|
|
60
58
|
(o) => {
|
|
61
|
-
o ?
|
|
59
|
+
o ? u() : $();
|
|
62
60
|
}
|
|
63
|
-
),
|
|
61
|
+
), p(
|
|
64
62
|
() => n.source,
|
|
65
63
|
() => {
|
|
66
|
-
|
|
64
|
+
u();
|
|
67
65
|
}
|
|
68
|
-
),
|
|
69
|
-
|
|
70
|
-
}),
|
|
66
|
+
), B(() => {
|
|
67
|
+
u();
|
|
68
|
+
}), F(() => {
|
|
71
69
|
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
72
|
-
}), (o,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
}), (o, e) => (c(), g(r(Q), {
|
|
71
|
+
size: "full",
|
|
72
|
+
state: r(l)
|
|
73
|
+
}, {
|
|
74
|
+
default: O(() => {
|
|
75
|
+
var y, b, _;
|
|
76
|
+
return [
|
|
77
|
+
t("div", te, [
|
|
78
|
+
t("div", {
|
|
79
|
+
class: T(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": r(s).state === "loading" }])
|
|
80
|
+
}, [
|
|
81
|
+
r(s).error && r(s).state === "idle" && !v.value ? (c(), m(f, { key: 0 }, [
|
|
82
|
+
e[2] || (e[2] = t("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
|
|
83
|
+
a(R, {
|
|
84
|
+
url: ((y = r(s)) == null ? void 0 : y.input) || n.source
|
|
85
|
+
}, null, 8, ["url"])
|
|
86
|
+
], 64)) : (c(), m(f, { key: 1 }, [
|
|
87
|
+
P.value ? (c(), g(K, {
|
|
86
88
|
key: 0,
|
|
87
89
|
integration: o.integration
|
|
88
|
-
}, null, 8, ["integration"])) :
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
e("div", ce, [
|
|
96
|
-
i(oe, {
|
|
97
|
-
source: ((_ = s(r)) == null ? void 0 : _.url) ?? o.source,
|
|
90
|
+
}, null, 8, ["integration"])) : x("", !0),
|
|
91
|
+
t("div", oe, q(V.value || "Untitled Collection"), 1),
|
|
92
|
+
e[5] || (e[5] = t("div", { class: "text-c-1 text-sm font-medium text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
|
|
93
|
+
v.value ? (c(), m(f, { key: 1 }, [
|
|
94
|
+
t("div", se, [
|
|
95
|
+
a(W, {
|
|
96
|
+
source: ((b = r(s)) == null ? void 0 : b.url) ?? o.source,
|
|
98
97
|
variant: "button",
|
|
99
98
|
watchMode: d.value,
|
|
100
|
-
onImportFinished:
|
|
99
|
+
onImportFinished: e[0] || (e[0] = () => o.$emit("importFinished"))
|
|
101
100
|
}, null, 8, ["source", "watchMode"])
|
|
102
101
|
]),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
t("div", ne, [
|
|
103
|
+
t("div", re, [
|
|
104
|
+
e[3] || (e[3] = w(" Import to: ")),
|
|
105
|
+
a(G)
|
|
107
106
|
])
|
|
108
107
|
]),
|
|
109
|
-
(
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
(_ = r(s)) != null && _.url ? (c(), m("div", le, [
|
|
109
|
+
t("div", ie, [
|
|
110
|
+
a(E, {
|
|
112
111
|
modelValue: d.value,
|
|
113
|
-
"onUpdate:modelValue":
|
|
112
|
+
"onUpdate:modelValue": e[1] || (e[1] = (j) => d.value = j),
|
|
114
113
|
disableToolTip: !0
|
|
115
114
|
}, null, 8, ["modelValue"])
|
|
116
115
|
]),
|
|
117
|
-
|
|
118
|
-
])) :
|
|
119
|
-
], 64)) :
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
content: ((b = s(r).content) == null ? void 0 : b.trim()) || ((g = n.source) == null ? void 0 : g.trim()) || "",
|
|
131
|
-
copy: !1
|
|
132
|
-
}, null, 8, ["content"])
|
|
116
|
+
e[4] || (e[4] = t("div", { class: "pt-0 text-center text-balance font-medium text-xs text-c-3" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
|
|
117
|
+
])) : x("", !0)
|
|
118
|
+
], 64)) : x("", !0)
|
|
119
|
+
], 64))
|
|
120
|
+
], 2),
|
|
121
|
+
t("div", ce, [
|
|
122
|
+
t("div", ae, [
|
|
123
|
+
t("div", me, [
|
|
124
|
+
t("a", de, [
|
|
125
|
+
a(r(X), {
|
|
126
|
+
icon: "Logo",
|
|
127
|
+
size: "xl"
|
|
128
|
+
})
|
|
133
129
|
])
|
|
134
|
-
]))
|
|
135
|
-
], 2),
|
|
136
|
-
e("div", he, [
|
|
137
|
-
e("div", ve, [
|
|
138
|
-
e("div", _e, [
|
|
139
|
-
e("a", ye, [
|
|
140
|
-
i(s(P), {
|
|
141
|
-
icon: "Logo",
|
|
142
|
-
size: "xl"
|
|
143
|
-
})
|
|
144
|
-
])
|
|
145
|
-
]),
|
|
146
|
-
t[6] || (t[6] = e("span", { class: "text-c-2 leading-snug text-sm font-medium" }, [
|
|
147
|
-
e("a", {
|
|
148
|
-
class: "hover:text-c-1 underline-offset-2 mb-1 inline-block",
|
|
149
|
-
href: "https://scalar.com/download",
|
|
150
|
-
target: "_blank"
|
|
151
|
-
}, " Download Desktop App "),
|
|
152
|
-
e("br"),
|
|
153
|
-
C(" free · open-source · offline first ")
|
|
154
|
-
], -1))
|
|
155
|
-
])
|
|
156
|
-
]),
|
|
157
|
-
i(s(L), {
|
|
158
|
-
size: "md",
|
|
159
|
-
state: s(E),
|
|
160
|
-
title: "Error Details",
|
|
161
|
-
variant: "error"
|
|
162
|
-
}, {
|
|
163
|
-
default: k(() => [
|
|
164
|
-
e("div", be, I(j.value), 1)
|
|
165
130
|
]),
|
|
166
|
-
|
|
167
|
-
|
|
131
|
+
e[6] || (e[6] = t("span", { class: "text-c-2 leading-snug text-sm font-medium" }, [
|
|
132
|
+
t("a", {
|
|
133
|
+
class: "hover:text-c-1 underline-offset-2 mb-1 inline-block",
|
|
134
|
+
href: "https://scalar.com/download",
|
|
135
|
+
target: "_blank"
|
|
136
|
+
}, " Download Desktop App "),
|
|
137
|
+
t("br"),
|
|
138
|
+
w(" free · open-source · offline first ")
|
|
139
|
+
], -1))
|
|
140
|
+
])
|
|
168
141
|
])
|
|
169
|
-
]
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
};
|
|
142
|
+
])
|
|
143
|
+
];
|
|
144
|
+
}),
|
|
145
|
+
_: 1
|
|
146
|
+
}, 8, ["state"]));
|
|
174
147
|
}
|
|
175
148
|
});
|
|
176
149
|
export {
|
|
177
|
-
|
|
150
|
+
Le as default
|
|
178
151
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { PrefetchResult } from '../../components/ImportCollection/hooks/useUrlPrefetcher.js';
|
|
2
1
|
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
|
|
2
|
+
url?: string | null;
|
|
4
3
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
5
|
-
|
|
4
|
+
url?: string | null;
|
|
6
5
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
6
|
export default _default;
|
|
8
7
|
//# sourceMappingURL=PrefetchError.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchError.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/PrefetchError.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrefetchError.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/PrefetchError.vue"],"names":[],"mappings":";UA8BQ,MAAM,GAAG,IAAI;;UAAb,MAAM,GAAG,IAAI;;AAwDrB,wBAMG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as l, openBlock as n, createElementBlock as o, createTextVNode as r, unref as d } from "vue";
|
|
2
|
+
import { isUrl as s } from "../../libs/isUrl.js";
|
|
3
|
+
const a = { class: "text-sm break-words text-center w-full font-medium" }, u = ["href"], m = {
|
|
4
|
+
key: 1,
|
|
5
|
+
textContent: "OpenAPI document manually"
|
|
6
|
+
}, c = /* @__PURE__ */ l({
|
|
7
|
+
__name: "PrefetchError",
|
|
8
|
+
props: {
|
|
9
|
+
url: {}
|
|
10
|
+
},
|
|
11
|
+
setup(p) {
|
|
12
|
+
return (t, e) => (n(), o("div", a, [
|
|
13
|
+
e[0] || (e[0] = r(" We couldn’t find an OpenAPI document at the provided URL. Please download and import the ")),
|
|
14
|
+
t.url && d(s)(t.url) ? (n(), o("a", {
|
|
15
|
+
key: 0,
|
|
16
|
+
href: t.url,
|
|
17
|
+
rel: "noopener nofollow",
|
|
18
|
+
target: "_blank",
|
|
19
|
+
textContent: "OpenAPI document manually"
|
|
20
|
+
}, null, 8, u)) : (n(), o("span", m)),
|
|
21
|
+
e[1] || (e[1] = r(". "))
|
|
22
|
+
]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
c as default
|
|
27
|
+
};
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
export type PrefetchResult = {
|
|
2
2
|
state: 'idle' | 'loading';
|
|
3
3
|
content: string | null;
|
|
4
|
+
input: string | null;
|
|
4
5
|
url: string | null;
|
|
5
6
|
error: string | null;
|
|
6
7
|
};
|
|
7
|
-
/**
|
|
8
|
-
* Core logic for fetching and processing a URL
|
|
9
|
-
*/
|
|
10
|
-
export declare function createUrlPrefetcher(): {
|
|
11
|
-
prefetchUrl: (value: string | null, proxy?: string) => Promise<{
|
|
12
|
-
state: string;
|
|
13
|
-
content: string;
|
|
14
|
-
url: string;
|
|
15
|
-
error: null;
|
|
16
|
-
} | {
|
|
17
|
-
state: string;
|
|
18
|
-
content: null;
|
|
19
|
-
url: null;
|
|
20
|
-
error: any;
|
|
21
|
-
}>;
|
|
22
|
-
};
|
|
23
8
|
/**
|
|
24
9
|
* Vue composable for URL prefetching
|
|
25
10
|
*/
|
|
@@ -27,18 +12,27 @@ export declare function useUrlPrefetcher(): {
|
|
|
27
12
|
prefetchResult: {
|
|
28
13
|
state: "idle" | "loading";
|
|
29
14
|
content: string | null;
|
|
15
|
+
input: string | null;
|
|
30
16
|
url: string | null;
|
|
31
17
|
error: string | null;
|
|
32
18
|
};
|
|
33
|
-
prefetchUrl: (
|
|
19
|
+
prefetchUrl: (input: string | null, proxy?: string) => Promise<{
|
|
20
|
+
state: string;
|
|
21
|
+
content: null;
|
|
22
|
+
url: null;
|
|
23
|
+
input: string | null;
|
|
24
|
+
error: null;
|
|
25
|
+
} | {
|
|
34
26
|
state: string;
|
|
35
27
|
content: string;
|
|
36
28
|
url: string;
|
|
37
29
|
error: null;
|
|
30
|
+
input?: undefined;
|
|
38
31
|
} | {
|
|
39
32
|
state: string;
|
|
40
33
|
content: null;
|
|
41
34
|
url: null;
|
|
35
|
+
input: string;
|
|
42
36
|
error: any;
|
|
43
37
|
}>;
|
|
44
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAuGX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;;;;;;;;;EAmBjB"}
|
|
@@ -1,47 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { resolve as a } from "@scalar/import";
|
|
2
|
+
import { redirectToProxy as i, fetchWithProxyFallback as f } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { reactive as d } from "vue";
|
|
4
|
+
import { isUrl as h } from "../../../libs/isUrl.js";
|
|
5
|
+
function v() {
|
|
6
|
+
const l = d({
|
|
7
|
+
state: "idle",
|
|
8
|
+
content: null,
|
|
9
|
+
url: null,
|
|
10
|
+
input: null,
|
|
11
|
+
error: null
|
|
12
|
+
});
|
|
13
|
+
async function u(t, r) {
|
|
14
|
+
if (!t)
|
|
15
|
+
return {
|
|
16
|
+
state: "idle",
|
|
17
|
+
content: null,
|
|
18
|
+
url: null,
|
|
19
|
+
input: t,
|
|
20
|
+
error: null
|
|
21
|
+
};
|
|
8
22
|
try {
|
|
9
|
-
const
|
|
10
|
-
|
|
23
|
+
const e = await a(t, {
|
|
24
|
+
fetch: (c) => fetch(r ? i(r, c) : c, {
|
|
25
|
+
cache: "no-cache"
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
if (typeof e == "object" && e !== null)
|
|
29
|
+
return { state: "idle", content: JSON.stringify(e, null, 2), url: t, error: null };
|
|
30
|
+
if (e === void 0)
|
|
31
|
+
return {
|
|
32
|
+
state: "idle",
|
|
33
|
+
content: null,
|
|
34
|
+
url: null,
|
|
35
|
+
input: t,
|
|
36
|
+
error: `Could not find an OpenAPI document in ${t}`
|
|
37
|
+
};
|
|
38
|
+
if (!h(e))
|
|
39
|
+
return {
|
|
40
|
+
state: "idle",
|
|
41
|
+
content: null,
|
|
42
|
+
url: null,
|
|
43
|
+
input: t,
|
|
44
|
+
error: "Oops, we got invalid content for the given URL."
|
|
45
|
+
};
|
|
46
|
+
const o = e, n = await f(o, {
|
|
47
|
+
proxy: r,
|
|
48
|
+
cache: "no-cache"
|
|
49
|
+
});
|
|
50
|
+
return n.ok ? {
|
|
51
|
+
state: "idle",
|
|
52
|
+
content: await n.text(),
|
|
53
|
+
url: o,
|
|
54
|
+
error: null
|
|
55
|
+
} : {
|
|
11
56
|
state: "idle",
|
|
12
57
|
content: null,
|
|
13
58
|
url: null,
|
|
14
|
-
|
|
59
|
+
input: t,
|
|
60
|
+
error: `Couldn't fetch ${o}, got error ${[n.status, n.statusText].join(" ").trim()}.`
|
|
61
|
+
};
|
|
62
|
+
} catch (e) {
|
|
63
|
+
return console.error("[prefetchDocument]", e), {
|
|
64
|
+
state: "idle",
|
|
65
|
+
content: null,
|
|
66
|
+
url: null,
|
|
67
|
+
input: t,
|
|
68
|
+
error: e.message
|
|
15
69
|
};
|
|
16
|
-
} catch (t) {
|
|
17
|
-
return console.error("[prefetchDocument]", t), { state: "idle", content: null, url: null, error: (n = t == null ? void 0 : t.message) != null && n.includes("Can’t fetch") ? `Couldn't reach ${e} — is it publicly accessible?` : t == null ? void 0 : t.message };
|
|
18
70
|
}
|
|
19
71
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function f() {
|
|
23
|
-
const r = o({
|
|
24
|
-
state: "idle",
|
|
25
|
-
content: null,
|
|
26
|
-
url: null,
|
|
27
|
-
error: null
|
|
28
|
-
}), { prefetchUrl: e } = u();
|
|
29
|
-
async function c(n, t) {
|
|
30
|
-
Object.assign(r, {
|
|
72
|
+
async function s(t, r) {
|
|
73
|
+
Object.assign(l, {
|
|
31
74
|
state: "loading",
|
|
32
75
|
content: null,
|
|
33
76
|
url: null,
|
|
77
|
+
input: t,
|
|
34
78
|
error: null
|
|
35
79
|
});
|
|
36
|
-
const
|
|
37
|
-
return Object.assign(
|
|
80
|
+
const e = await u(t, r);
|
|
81
|
+
return Object.assign(l, e), e;
|
|
38
82
|
}
|
|
39
83
|
return {
|
|
40
|
-
prefetchResult:
|
|
41
|
-
prefetchUrl:
|
|
84
|
+
prefetchResult: l,
|
|
85
|
+
prefetchUrl: s
|
|
42
86
|
};
|
|
43
87
|
}
|
|
44
88
|
export {
|
|
45
|
-
|
|
46
|
-
f as useUrlPrefetcher
|
|
89
|
+
v as useUrlPrefetcher
|
|
47
90
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
buttonSource: "sidebar" | "modal";
|
|
3
3
|
isDevelopment?: boolean;
|
|
4
|
-
integration?: string | null
|
|
5
|
-
url?: string
|
|
4
|
+
integration?: string | null;
|
|
5
|
+
url?: string;
|
|
6
6
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
7
7
|
buttonSource: "sidebar" | "modal";
|
|
8
8
|
isDevelopment?: boolean;
|
|
9
|
-
integration?: string | null
|
|
10
|
-
url?: string
|
|
9
|
+
integration?: string | null;
|
|
10
|
+
url?: string;
|
|
11
11
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
export default _default;
|
|
13
13
|
//# sourceMappingURL=OpenApiClientButton.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenApiClientButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/OpenApiClientButton.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"OpenApiClientButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/OpenApiClientButton.vue"],"names":[],"mappings":";kBA6FgB,SAAS,GAAG,OAAO;oBACjB,OAAO;kBACT,MAAM,GAAG,IAAI;UACrB,MAAM;;kBAHE,SAAS,GAAG,OAAO;oBACjB,OAAO;kBACT,MAAM,GAAG,IAAI;UACrB,MAAM;;AA0Fd,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./OpenApiClientButton.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-3d5f00c1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as o, computed as a, openBlock as i, createElementBlock as s, createVNode as c, unref as m, createTextVNode as u, createCommentVNode as l } from "vue";
|
|
2
2
|
import { ScalarIcon as p } from "@scalar/components";
|
|
3
3
|
import { makeUrlAbsolute as f } from "@scalar/oas-utils/helpers";
|
|
4
|
-
const h = ["href"],
|
|
4
|
+
const h = ["href"], v = /* @__PURE__ */ o({
|
|
5
5
|
__name: "OpenApiClientButton",
|
|
6
6
|
props: {
|
|
7
7
|
buttonSource: {},
|
|
@@ -9,14 +9,17 @@ const h = ["href"], P = /* @__PURE__ */ a({
|
|
|
9
9
|
integration: {},
|
|
10
10
|
url: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const r =
|
|
12
|
+
setup(t) {
|
|
13
|
+
const r = a(() => {
|
|
14
|
+
const n = f(t.url);
|
|
15
|
+
if (!(n != null && n.length))
|
|
16
|
+
return;
|
|
14
17
|
const e = new URL(
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
return
|
|
18
|
+
t.isDevelopment ? "http://localhost:5065" : "https://client.scalar.com"
|
|
19
|
+
);
|
|
20
|
+
return e.searchParams.set("url", n), t.integration !== null && e.searchParams.set("integration", t.integration ?? "vue"), e.searchParams.set("utm_source", "api-reference"), e.searchParams.set("utm_medium", "button"), e.searchParams.set("utm_campaign", t.buttonSource), e.toString();
|
|
18
21
|
});
|
|
19
|
-
return (
|
|
22
|
+
return (n, e) => r.value ? (i(), s("a", {
|
|
20
23
|
key: 0,
|
|
21
24
|
class: "open-api-client-button",
|
|
22
25
|
href: r.value,
|
|
@@ -27,10 +30,10 @@ const h = ["href"], P = /* @__PURE__ */ a({
|
|
|
27
30
|
size: "xs",
|
|
28
31
|
thickness: "2.5"
|
|
29
32
|
}),
|
|
30
|
-
|
|
31
|
-
], 8, h)) :
|
|
33
|
+
e[0] || (e[0] = u(" Open API Client "))
|
|
34
|
+
], 8, h)) : l("", !0);
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
export {
|
|
35
|
-
|
|
38
|
+
v as default
|
|
36
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarListElementForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Sidebar/Actions/SidebarListElementForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarListElementForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Sidebar/Actions/SidebarListElementForm.vue"],"names":[],"mappings":"AAuEA,iBAAS,cAAc;qBAmGM,GAAG;EAoB/B;AACD,QAAA,MAAM,eAAe;aA3IV,OAAO;YACR,MAAM;;;;;aADL,OAAO;YACR,MAAM;;;;kFAoJd,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidebarListElementForm.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-194bccb5"]]);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|