@scalar/api-client 2.2.6 → 2.2.8
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/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +18 -18
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +108 -106
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +20 -20
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +12 -12
- package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue2.js +12 -12
- package/dist/components/HttpMethod/index.d.ts +0 -1
- package/dist/components/HttpMethod/index.d.ts.map +1 -1
- package/dist/components/HttpMethod/index.js +2 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +119 -102
- package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/OpenApiClientButton.vue2.js +23 -17
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +45 -41
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
- package/dist/libs/create-client.d.ts +1 -0
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +31 -30
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +28 -24
- package/dist/libs/postman.d.ts +11 -0
- package/dist/libs/postman.d.ts.map +1 -0
- package/dist/libs/postman.js +39 -0
- package/dist/style.css +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +65 -62
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +82 -84
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +27 -24
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +4 -4
- package/dist/views/Request/RequestSidebar.vue2.js +32 -30
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -32
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +77 -78
- package/package.json +10 -9
- package/dist/components/HttpMethod/helpers.d.ts +0 -4
- package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
- package/dist/components/HttpMethod/helpers.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as q, ref as i, computed as T, watch as F, onMounted as G, onBeforeUnmount as Q, openBlock as a, createBlock as z, unref as r, withCtx as y, createElementVNode as u, createVNode as p, createTextVNode as K, createElementBlock as m, withDirectives as M, withKeys as w, withModifiers as g, vModelText as j, Fragment as
|
|
2
|
-
import { useModal as oe, ScalarIcon as
|
|
1
|
+
import { defineComponent as q, ref as i, computed as T, watch as F, onMounted as G, onBeforeUnmount as Q, openBlock as a, createBlock as z, unref as r, withCtx as y, createElementVNode as u, createVNode as p, createTextVNode as K, createElementBlock as m, withDirectives as M, withKeys as w, withModifiers as g, vModelText as j, Fragment as P, renderList as B, toDisplayString as N, vShow as J, normalizeClass as X, createCommentVNode as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as V } from "vue";
|
|
2
|
+
import { useModal as oe, ScalarIcon as A } from "@scalar/components";
|
|
3
3
|
import { Dialog as te, DialogPanel as ne, DialogTitle as ae } from "@headlessui/vue";
|
|
4
4
|
import { useRouter as le } from "vue-router";
|
|
5
5
|
import { ROUTES as se } from "../../constants.js";
|
|
@@ -24,7 +24,7 @@ const he = {
|
|
|
24
24
|
}, we = {
|
|
25
25
|
name: "TheCommandPalette"
|
|
26
26
|
}, ge = {
|
|
27
|
-
"Import from OpenAPI/Swagger": ie,
|
|
27
|
+
"Import from OpenAPI/Swagger/Postman": ie,
|
|
28
28
|
"Create Request": ue,
|
|
29
29
|
"Create Workspace": fe,
|
|
30
30
|
"Add Tag": pe,
|
|
@@ -33,8 +33,8 @@ const he = {
|
|
|
33
33
|
"Add Example": ce
|
|
34
34
|
}, Ve = /* @__PURE__ */ q({
|
|
35
35
|
...we,
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
36
|
+
setup(Pe) {
|
|
37
|
+
const S = [
|
|
38
38
|
{
|
|
39
39
|
label: "",
|
|
40
40
|
commands: [
|
|
@@ -43,7 +43,7 @@ const he = {
|
|
|
43
43
|
icon: "ExternalLink"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
name: "Import from OpenAPI/Swagger",
|
|
46
|
+
name: "Import from OpenAPI/Swagger/Postman",
|
|
47
47
|
icon: "Import"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
@@ -92,7 +92,7 @@ const he = {
|
|
|
92
92
|
}))
|
|
93
93
|
}
|
|
94
94
|
], d = oe(), { push: W } = le(), { activeWorkspace: H } = re(), { events: f } = ve(), x = i(), l = i(""), s = i(null), c = i(-1), D = i([]), v = T(
|
|
95
|
-
() =>
|
|
95
|
+
() => S.reduce((e, o) => {
|
|
96
96
|
const t = o.commands.filter(
|
|
97
97
|
(n) => n.name.toLowerCase().includes(l.value.toLowerCase())
|
|
98
98
|
);
|
|
@@ -164,7 +164,7 @@ const he = {
|
|
|
164
164
|
type: "button",
|
|
165
165
|
onClick: o[3] || (o[3] = (t) => s.value = null)
|
|
166
166
|
}, [
|
|
167
|
-
p(r(
|
|
167
|
+
p(r(A), {
|
|
168
168
|
icon: "ChevronLeft",
|
|
169
169
|
size: "md",
|
|
170
170
|
thickness: "1.5"
|
|
@@ -177,7 +177,7 @@ const he = {
|
|
|
177
177
|
])) : (a(), m("div", he, [
|
|
178
178
|
u("div", Ce, [
|
|
179
179
|
u("label", xe, [
|
|
180
|
-
p(r(
|
|
180
|
+
p(r(A), {
|
|
181
181
|
class: "text-c-2 mr-2.5",
|
|
182
182
|
icon: "Search",
|
|
183
183
|
size: "md",
|
|
@@ -203,7 +203,7 @@ const he = {
|
|
|
203
203
|
[j, l.value]
|
|
204
204
|
])
|
|
205
205
|
]),
|
|
206
|
-
(a(), m(
|
|
206
|
+
(a(), m(P, null, B(S, (t) => (a(), m(P, {
|
|
207
207
|
key: t.label
|
|
208
208
|
}, [
|
|
209
209
|
M(u("div", { class: "text-c-3 font-medium text-xs px-2 mb-1 mt-2" }, N(t.label), 513), [
|
|
@@ -214,7 +214,7 @@ const he = {
|
|
|
214
214
|
).length > 0
|
|
215
215
|
]
|
|
216
216
|
]),
|
|
217
|
-
(a(!0), m(
|
|
217
|
+
(a(!0), m(P, null, B(t.commands.filter(
|
|
218
218
|
(n) => n.name.toLowerCase().includes(l.value.toLowerCase())
|
|
219
219
|
), (n, C) => {
|
|
220
220
|
var L;
|
|
@@ -229,7 +229,7 @@ const he = {
|
|
|
229
229
|
}]),
|
|
230
230
|
onClick: (b) => $(n)
|
|
231
231
|
}, [
|
|
232
|
-
p(r(
|
|
232
|
+
p(r(A), {
|
|
233
233
|
class: "text-c-2 mr-2.5",
|
|
234
234
|
icon: n.icon,
|
|
235
235
|
size: "md",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./HttpMethod.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ o(t, [["__scopeId", "data-v-46723816"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as
|
|
2
|
-
import { cva as
|
|
1
|
+
import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as l, normalizeClass as s, toDisplayString as p, createElementBlock as k } from "vue";
|
|
2
|
+
import { cva as w, ScalarListbox as x, cx as m } from "@scalar/components";
|
|
3
3
|
import { getHttpMethodInfo as f, REQUEST_METHODS as B } from "@scalar/oas-utils/helpers";
|
|
4
4
|
const H = /* @__PURE__ */ g({
|
|
5
5
|
__name: "HttpMethod",
|
|
@@ -12,12 +12,12 @@ const H = /* @__PURE__ */ g({
|
|
|
12
12
|
setup(b, { emit: h }) {
|
|
13
13
|
const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(B).map(([e]) => ({
|
|
14
14
|
id: e,
|
|
15
|
-
label: e.
|
|
15
|
+
label: e.toUpperCase(),
|
|
16
16
|
color: f(e).color
|
|
17
17
|
})), i = a({
|
|
18
18
|
get: () => n.find(({ id: e }) => e === r.method),
|
|
19
19
|
set: (e) => (e == null ? void 0 : e.id) && v("change", e.id)
|
|
20
|
-
}), d =
|
|
20
|
+
}), d = w({
|
|
21
21
|
base: "text-center font-code text-3xs justify-center items-center flex",
|
|
22
22
|
variants: {
|
|
23
23
|
isSquare: {
|
|
@@ -34,25 +34,25 @@ const H = /* @__PURE__ */ g({
|
|
|
34
34
|
key: 0,
|
|
35
35
|
modelValue: i.value,
|
|
36
36
|
"onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
|
|
37
|
-
class: "mt-1 font-code text-sm
|
|
37
|
+
class: "mt-1 font-code text-sm scalar-client",
|
|
38
38
|
options: t(n)
|
|
39
39
|
}, {
|
|
40
40
|
default: q(() => [
|
|
41
|
-
|
|
42
|
-
class:
|
|
41
|
+
l("div", {
|
|
42
|
+
class: s(["h-full", { "pointer-events-none": !e.isEditable }])
|
|
43
43
|
}, [
|
|
44
|
-
|
|
45
|
-
class:
|
|
44
|
+
l("button", {
|
|
45
|
+
class: s(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
46
46
|
type: "button"
|
|
47
47
|
}, [
|
|
48
|
-
|
|
48
|
+
l("span", null, p(E.value), 1)
|
|
49
49
|
], 2)
|
|
50
50
|
], 2)
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
53
|
-
}, 8, ["modelValue", "options"])) : (c(),
|
|
53
|
+
}, 8, ["modelValue", "options"])) : (c(), k("div", {
|
|
54
54
|
key: 1,
|
|
55
|
-
class:
|
|
55
|
+
class: s(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
56
56
|
type: "button"
|
|
57
57
|
}, p(o.value.short), 3));
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"AA4ZA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7C,CAAC;;;;;;AAodF,wBAQG"}
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useUrlPrefetcher as
|
|
8
|
-
import { getOpenApiDocumentVersion as
|
|
1
|
+
import { defineComponent as H, ref as W, computed as c, watch as _, onMounted as K, onUnmounted as G, openBlock as l, createBlock as J, unref as i, withCtx as Q, createElementBlock as a, createCommentVNode as m, createElementVNode as e, normalizeClass as X, Fragment as g, createVNode as d, toDisplayString as Y, createTextVNode as M } from "vue";
|
|
2
|
+
import Z from "../CommandPalette/WatchModeToggle.vue.js";
|
|
3
|
+
import ee from "./ImportNowButton.vue.js";
|
|
4
|
+
import te from "./IntegrationLogo.vue.js";
|
|
5
|
+
import oe from "./PrefetchError.vue.js";
|
|
6
|
+
import se from "./WorkspaceSelector.vue.js";
|
|
7
|
+
import { useUrlPrefetcher as ne } from "./hooks/useUrlPrefetcher.js";
|
|
8
|
+
import { getOpenApiDocumentVersion as U } from "./utils/getOpenApiDocumentVersion.js";
|
|
9
9
|
import { isDocument as A } from "./utils/isDocument.js";
|
|
10
|
-
import { isUrl as
|
|
11
|
-
import { useActiveEntities as
|
|
12
|
-
import { useModal as
|
|
13
|
-
import { isLocalUrl as
|
|
14
|
-
import { normalize as
|
|
15
|
-
import { getThemeStyles as
|
|
16
|
-
import {
|
|
17
|
-
|
|
10
|
+
import { isUrl as C } from "./utils/isUrl.js";
|
|
11
|
+
import { useActiveEntities as re } from "../../store/active-entities.js";
|
|
12
|
+
import { useModal as ie, ScalarModal as le, ScalarIcon as ce } from "@scalar/components";
|
|
13
|
+
import { isLocalUrl as ae } from "@scalar/oas-utils/helpers";
|
|
14
|
+
import { normalize as de } from "@scalar/openapi-parser";
|
|
15
|
+
import { getThemeStyles as me } from "@scalar/themes";
|
|
16
|
+
import { useColorMode as ue } from "@scalar/use-hooks/useColorMode";
|
|
17
|
+
import { useRouter as pe } from "vue-router";
|
|
18
|
+
import { useWorkspace as fe } from "../../store/store.js";
|
|
19
|
+
const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, xe = {
|
|
18
20
|
key: 0,
|
|
19
21
|
class: "flex justify-center items-center mb-2 p-1"
|
|
20
|
-
},
|
|
22
|
+
}, ye = { class: "rounded-xl size-10" }, _e = ["src"], ge = {
|
|
23
|
+
key: 2,
|
|
24
|
+
class: "text-center text-md font-bold mb-2 line-clamp-1"
|
|
25
|
+
}, be = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, we = { class: "flex justify-center" }, ke = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, Ie = {
|
|
21
26
|
key: 0,
|
|
22
27
|
class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
|
|
23
|
-
},
|
|
28
|
+
}, Le = { class: "flex items-center justify-center" }, Me = { class: "flex flex-col justify-center items-center pb-8" }, Ue = { class: "text-center flex items-center flex-col" }, Ae = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, Ce = {
|
|
24
29
|
href: "https://scalar.com/download",
|
|
25
30
|
target: "_blank"
|
|
26
|
-
},
|
|
31
|
+
}, Ge = /* @__PURE__ */ H({
|
|
27
32
|
__name: "ImportCollectionModal",
|
|
28
33
|
props: {
|
|
29
34
|
source: {},
|
|
@@ -31,84 +36,91 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
|
|
|
31
36
|
eventType: {}
|
|
32
37
|
},
|
|
33
38
|
emits: ["importFinished"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
39
|
+
setup(T, { emit: P }) {
|
|
40
|
+
const s = T, D = P, { activeWorkspace: u } = re(), { workspaceMutators: V, events: j } = fe(), { prefetchResult: n, prefetchUrl: b, resetPrefetchResult: S } = ne(), r = ie(), f = W(!0);
|
|
41
|
+
j.hotKeys.on(() => r.hide());
|
|
42
|
+
const z = c(() => {
|
|
38
43
|
try {
|
|
39
|
-
return
|
|
40
|
-
n.content ||
|
|
44
|
+
return de(
|
|
45
|
+
n.content || s.source || ""
|
|
41
46
|
);
|
|
42
47
|
} catch {
|
|
43
48
|
return;
|
|
44
49
|
}
|
|
45
|
-
}),
|
|
46
|
-
var
|
|
47
|
-
return (t = (
|
|
48
|
-
}),
|
|
49
|
-
() =>
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
}), N = c(() => {
|
|
51
|
+
var o, t;
|
|
52
|
+
return (t = (o = z.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
|
|
53
|
+
}), w = c(
|
|
54
|
+
() => U(n.content || s.source || "")
|
|
55
|
+
), { darkLightMode: O } = ue(), { currentRoute: $ } = pe(), v = c(() => {
|
|
56
|
+
try {
|
|
57
|
+
const o = $.value.query, t = O.value === "dark" ? o.dark_logo : o.light_logo;
|
|
58
|
+
if (t) return decodeURIComponent(t);
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
});
|
|
63
|
+
_(
|
|
64
|
+
() => s.source,
|
|
65
|
+
async (o) => {
|
|
54
66
|
var t;
|
|
55
|
-
if (S(),
|
|
56
|
-
if (
|
|
57
|
-
const { error:
|
|
58
|
-
|
|
59
|
-
(t =
|
|
67
|
+
if (S(), C(o)) {
|
|
68
|
+
if (s.eventType && ["paste", "drop"].includes(s.eventType)) {
|
|
69
|
+
const { error: p } = await b(
|
|
70
|
+
o,
|
|
71
|
+
(t = u.value) == null ? void 0 : t.proxyUrl
|
|
60
72
|
);
|
|
61
|
-
|
|
73
|
+
p ? r.hide() : r.show();
|
|
62
74
|
return;
|
|
63
75
|
}
|
|
64
|
-
b(
|
|
76
|
+
b(o, u.value.proxyUrl), r.show();
|
|
65
77
|
return;
|
|
66
78
|
}
|
|
67
|
-
|
|
79
|
+
o && A(o) && U(o) ? r.show() : r.hide();
|
|
68
80
|
}
|
|
69
81
|
);
|
|
70
|
-
const
|
|
71
|
-
document.body.classList.remove("has-no-import-url"), (
|
|
72
|
-
},
|
|
82
|
+
const E = c(() => !!s.source && C(s.source)), F = c(() => !!s.source && A(s.source)), h = c(() => n.url && ae(n.url)), x = (o) => {
|
|
83
|
+
document.body.classList.remove("has-no-import-url"), (E.value || F.value) && r.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
84
|
+
}, R = () => {
|
|
73
85
|
document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
|
|
74
86
|
};
|
|
75
|
-
|
|
76
|
-
() =>
|
|
77
|
-
(
|
|
78
|
-
|
|
87
|
+
_(
|
|
88
|
+
() => r.open,
|
|
89
|
+
(o) => {
|
|
90
|
+
o ? x() : R();
|
|
79
91
|
}
|
|
80
|
-
),
|
|
81
|
-
() =>
|
|
92
|
+
), _(
|
|
93
|
+
() => s.source,
|
|
82
94
|
() => {
|
|
83
|
-
|
|
95
|
+
x();
|
|
84
96
|
}
|
|
85
|
-
),
|
|
86
|
-
|
|
87
|
-
}),
|
|
97
|
+
), K(() => {
|
|
98
|
+
x();
|
|
99
|
+
}), G(() => {
|
|
88
100
|
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
89
101
|
});
|
|
90
|
-
const
|
|
91
|
-
() =>
|
|
102
|
+
const k = c(
|
|
103
|
+
() => u.value && h.value && s.integration && `<style>${me(s.integration)}</style>`
|
|
92
104
|
);
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
105
|
+
function q() {
|
|
106
|
+
h.value && s.integration && V.edit(
|
|
107
|
+
u.value.uid,
|
|
96
108
|
"themeId",
|
|
97
|
-
|
|
98
|
-
),
|
|
109
|
+
s.integration
|
|
110
|
+
), D("importFinished");
|
|
99
111
|
}
|
|
100
|
-
return (
|
|
112
|
+
return (o, t) => (l(), J(i(le), {
|
|
101
113
|
size: "full",
|
|
102
|
-
state: r
|
|
114
|
+
state: i(r)
|
|
103
115
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
var
|
|
116
|
+
default: Q(() => {
|
|
117
|
+
var y, p, I, L;
|
|
106
118
|
return [
|
|
107
|
-
|
|
119
|
+
k.value ? (l(), a("div", {
|
|
108
120
|
key: 0,
|
|
109
|
-
innerHTML:
|
|
110
|
-
}, null, 8,
|
|
111
|
-
e("div",
|
|
121
|
+
innerHTML: k.value
|
|
122
|
+
}, null, 8, ve)) : m("", !0),
|
|
123
|
+
e("div", he, [
|
|
112
124
|
t[6] || (t[6] = e("div", { class: "section-flare" }, [
|
|
113
125
|
e("div", { class: "section-flare-item" }),
|
|
114
126
|
e("div", { class: "section-flare-item" }),
|
|
@@ -120,54 +132,59 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
|
|
|
120
132
|
e("div", { class: "section-flare-item" })
|
|
121
133
|
], -1)),
|
|
122
134
|
e("div", {
|
|
123
|
-
class:
|
|
135
|
+
class: X(["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": i(n).state === "loading" }])
|
|
124
136
|
}, [
|
|
125
|
-
|
|
137
|
+
i(n).error && i(n).state === "idle" && !w.value ? (l(), a(g, { key: 0 }, [
|
|
126
138
|
t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
|
|
127
|
-
d(
|
|
128
|
-
url: ((
|
|
139
|
+
d(oe, {
|
|
140
|
+
url: ((y = i(n)) == null ? void 0 : y.input) || s.source
|
|
129
141
|
}, null, 8, ["url"])
|
|
130
|
-
], 64)) : (
|
|
131
|
-
|
|
132
|
-
e("div",
|
|
133
|
-
d(
|
|
142
|
+
], 64)) : (l(), a(g, { key: 1 }, [
|
|
143
|
+
h.value ? (l(), a("div", xe, [
|
|
144
|
+
e("div", ye, [
|
|
145
|
+
d(te, { integration: o.integration }, null, 8, ["integration"])
|
|
134
146
|
])
|
|
135
|
-
])) :
|
|
136
|
-
|
|
147
|
+
])) : v.value ? (l(), a("img", {
|
|
148
|
+
key: 1,
|
|
149
|
+
alt: "Logo",
|
|
150
|
+
class: "w-full object-contain mb-2",
|
|
151
|
+
src: v.value
|
|
152
|
+
}, null, 8, _e)) : m("", !0),
|
|
153
|
+
v.value ? m("", !0) : (l(), a("div", ge, Y(N.value || "Untitled Collection"), 1)),
|
|
137
154
|
t[4] || (t[4] = e("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)),
|
|
138
|
-
|
|
139
|
-
e("div",
|
|
140
|
-
d(
|
|
141
|
-
source: ((
|
|
155
|
+
w.value ? (l(), a(g, { key: 3 }, [
|
|
156
|
+
e("div", be, [
|
|
157
|
+
d(ee, {
|
|
158
|
+
source: ((p = i(n)) == null ? void 0 : p.url) ?? ((I = i(n)) == null ? void 0 : I.content) ?? o.source,
|
|
142
159
|
variant: "button",
|
|
143
160
|
watchMode: f.value,
|
|
144
|
-
onImportFinished:
|
|
161
|
+
onImportFinished: q
|
|
145
162
|
}, null, 8, ["source", "watchMode"])
|
|
146
163
|
]),
|
|
147
|
-
e("div",
|
|
148
|
-
e("div",
|
|
149
|
-
t[2] || (t[2] =
|
|
150
|
-
d(
|
|
164
|
+
e("div", we, [
|
|
165
|
+
e("div", ke, [
|
|
166
|
+
t[2] || (t[2] = M(" Import to: ")),
|
|
167
|
+
d(se)
|
|
151
168
|
])
|
|
152
169
|
]),
|
|
153
|
-
(
|
|
154
|
-
e("div",
|
|
155
|
-
d(
|
|
170
|
+
(L = i(n)) != null && L.url ? (l(), a("div", Ie, [
|
|
171
|
+
e("div", Le, [
|
|
172
|
+
d(Z, {
|
|
156
173
|
modelValue: f.value,
|
|
157
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
174
|
+
"onUpdate:modelValue": t[0] || (t[0] = (B) => f.value = B),
|
|
158
175
|
disableToolTip: !0
|
|
159
176
|
}, null, 8, ["modelValue"])
|
|
160
177
|
]),
|
|
161
178
|
t[3] || (t[3] = e("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))
|
|
162
|
-
])) :
|
|
163
|
-
], 64)) :
|
|
179
|
+
])) : m("", !0)
|
|
180
|
+
], 64)) : m("", !0)
|
|
164
181
|
], 64))
|
|
165
182
|
], 2),
|
|
166
|
-
e("div",
|
|
167
|
-
e("div",
|
|
168
|
-
e("div",
|
|
169
|
-
e("a",
|
|
170
|
-
d(
|
|
183
|
+
e("div", Me, [
|
|
184
|
+
e("div", Ue, [
|
|
185
|
+
e("div", Ae, [
|
|
186
|
+
e("a", Ce, [
|
|
187
|
+
d(i(ce), {
|
|
171
188
|
icon: "Logo",
|
|
172
189
|
size: "xl"
|
|
173
190
|
})
|
|
@@ -180,7 +197,7 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
|
|
|
180
197
|
target: "_blank"
|
|
181
198
|
}, " Download Desktop App "),
|
|
182
199
|
e("br"),
|
|
183
|
-
|
|
200
|
+
M(" free · open-source · offline first ")
|
|
184
201
|
], -1))
|
|
185
202
|
])
|
|
186
203
|
])
|
|
@@ -192,5 +209,5 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
|
|
|
192
209
|
}
|
|
193
210
|
});
|
|
194
211
|
export {
|
|
195
|
-
|
|
212
|
+
Ge as default
|
|
196
213
|
};
|
|
@@ -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":"AAuHA,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,SAAS,GAAG,OAAO,CAAA;IACjC,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAAA;IACpC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAC;;AA4HF,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 r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-2e9f75f1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,39 +1,45 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
import { makeUrlAbsolute as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as i, computed as s, openBlock as m, createElementBlock as l, createVNode as u, unref as d, createTextVNode as f, createCommentVNode as g } from "vue";
|
|
2
|
+
import { ScalarIcon as h } from "@scalar/components";
|
|
3
|
+
import { makeUrlAbsolute as p } from "@scalar/oas-utils/helpers";
|
|
4
|
+
const k = ["href"], v = /* @__PURE__ */ i({
|
|
5
5
|
__name: "OpenApiClientButton",
|
|
6
6
|
props: {
|
|
7
7
|
buttonSource: {},
|
|
8
|
+
source: { default: "api-reference" },
|
|
8
9
|
isDevelopment: { type: Boolean },
|
|
9
10
|
integration: {},
|
|
10
11
|
url: {}
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
if (!(
|
|
13
|
+
setup(o) {
|
|
14
|
+
const a = s(() => {
|
|
15
|
+
const c = o.url ?? (typeof window < "u" ? window.location.href : void 0), t = p(c);
|
|
16
|
+
if (!(t != null && t.length))
|
|
16
17
|
return;
|
|
17
|
-
const
|
|
18
|
-
|
|
18
|
+
const e = new URL(
|
|
19
|
+
o.isDevelopment ? "http://localhost:5065" : "https://client.scalar.com"
|
|
19
20
|
);
|
|
20
|
-
|
|
21
|
+
if (e.searchParams.set("url", t), o.integration !== null && e.searchParams.set("integration", o.integration ?? "vue"), e.searchParams.set("utm_source", "api-reference"), e.searchParams.set("utm_medium", "button"), e.searchParams.set("utm_campaign", o.buttonSource), o.source === "gitbook") {
|
|
22
|
+
e.searchParams.set("utm_source", "gitbook");
|
|
23
|
+
const n = document.querySelector("img.dark\\:block[alt='Logo']"), r = document.querySelector("img.dark\\:hidden[alt='Logo']");
|
|
24
|
+
n && n instanceof HTMLImageElement && e.searchParams.set("dark_logo", encodeURIComponent(n.src)), r && r instanceof HTMLImageElement && e.searchParams.set("light_logo", encodeURIComponent(r.src));
|
|
25
|
+
}
|
|
26
|
+
return e.toString();
|
|
21
27
|
});
|
|
22
|
-
return (
|
|
28
|
+
return (c, t) => a.value ? (m(), l("a", {
|
|
23
29
|
key: 0,
|
|
24
30
|
class: "open-api-client-button",
|
|
25
|
-
href:
|
|
31
|
+
href: a.value,
|
|
26
32
|
target: "_blank"
|
|
27
33
|
}, [
|
|
28
|
-
|
|
34
|
+
u(d(h), {
|
|
29
35
|
icon: "ExternalLink",
|
|
30
36
|
size: "xs",
|
|
31
37
|
thickness: "2.5"
|
|
32
38
|
}),
|
|
33
|
-
|
|
34
|
-
], 8,
|
|
39
|
+
t[0] || (t[0] = f(" Open API Client "))
|
|
40
|
+
], 8, k)) : g("", !0);
|
|
35
41
|
}
|
|
36
42
|
});
|
|
37
43
|
export {
|
|
38
|
-
|
|
44
|
+
v as default
|
|
39
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/components/Search/useSearch.ts"],"names":[],"mappings":"AAGA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/C;;;GAGG;AACH,wBAAgB,SAAS;;;eAMd,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;;;
|
|
1
|
+
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/components/Search/useSearch.ts"],"names":[],"mappings":"AAGA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/C;;;GAGG;AACH,wBAAgB,SAAS;;;eAMd,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;;;iCAqFsB,UAAU;eA1FrC,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;MAqF0C;sBAlDjC,IAAI;;;uCAae,IAAI,GAAG,MAAM;;EAmExD"}
|