@scalar/api-client 2.2.3 → 2.2.6
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 +69 -0
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +15 -15
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +24 -24
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -5
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +5 -6
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +8 -8
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +37 -47
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
- package/dist/components/HttpMethod/HttpMethod.vue2.js +16 -17
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +85 -84
- package/dist/components/ImportCollection/ImportNowButton.vue.js +3 -3
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +24 -26
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +6 -0
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +28 -23
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +1 -1
- package/dist/components/OpenApiClientButton.vue2.js +16 -16
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +72 -70
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue2.js +83 -81
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -6
- package/dist/layouts/App/create-api-client-app.d.ts +3 -2
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.js +6 -6
- package/dist/layouts/Modal/create-api-client-modal.d.ts +6 -4
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +3 -2
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.js +4 -4
- package/dist/libs/create-client.d.ts +6 -5
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +38 -37
- package/dist/libs/index.d.ts +1 -2
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +20 -20
- package/dist/libs/send-request/index.d.ts +2 -0
- package/dist/libs/send-request/index.d.ts.map +1 -0
- package/dist/libs/send-request/index.js +9 -0
- package/dist/libs/{send-request.d.ts → send-request/send-request.d.ts} +6 -6
- package/dist/libs/send-request/send-request.d.ts.map +1 -0
- package/dist/libs/{send-request.js → send-request/send-request.js} +29 -29
- package/dist/store/events.d.ts +1 -1
- package/dist/store/import-spec.d.ts +1 -1
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +1 -1
- package/dist/store/store.d.ts +6 -4
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +47 -45
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +18 -20
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +76 -72
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +30 -30
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +20 -19
- 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 +2 -2
- 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 +245 -191
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +60 -61
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +188 -196
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +153 -147
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +24 -28
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +5 -5
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -25
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +41 -30
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +50 -58
- package/dist/views/Request/libs/oauth2.d.ts +6 -2
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +43 -37
- package/package.json +18 -14
- package/dist/libs/send-request.d.ts.map +0 -1
|
@@ -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 f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-fcbb6eeb"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as s, normalizeClass as l, toDisplayString as p, createElementBlock as w } from "vue";
|
|
2
|
-
import { ScalarListbox as x } from "@scalar/components";
|
|
3
|
-
import { getHttpMethodInfo as
|
|
4
|
-
|
|
5
|
-
const L = /* @__PURE__ */ g({
|
|
2
|
+
import { cva as k, ScalarListbox as x, cx as m } from "@scalar/components";
|
|
3
|
+
import { getHttpMethodInfo as f, REQUEST_METHODS as B } from "@scalar/oas-utils/helpers";
|
|
4
|
+
const H = /* @__PURE__ */ g({
|
|
6
5
|
__name: "HttpMethod",
|
|
7
6
|
props: {
|
|
8
7
|
isSquare: { type: Boolean, default: !1 },
|
|
@@ -11,14 +10,14 @@ const L = /* @__PURE__ */ g({
|
|
|
11
10
|
},
|
|
12
11
|
emits: ["change"],
|
|
13
12
|
setup(b, { emit: h }) {
|
|
14
|
-
const r = b, v = h, o = a(() =>
|
|
13
|
+
const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(B).map(([e]) => ({
|
|
15
14
|
id: e,
|
|
16
15
|
label: e.charAt(0) + e.toLowerCase().slice(1),
|
|
17
|
-
color:
|
|
18
|
-
})),
|
|
19
|
-
get: () =>
|
|
16
|
+
color: f(e).color
|
|
17
|
+
})), i = a({
|
|
18
|
+
get: () => n.find(({ id: e }) => e === r.method),
|
|
20
19
|
set: (e) => (e == null ? void 0 : e.id) && v("change", e.id)
|
|
21
|
-
}), d =
|
|
20
|
+
}), d = k({
|
|
22
21
|
base: "text-center font-code text-3xs justify-center items-center flex",
|
|
23
22
|
variants: {
|
|
24
23
|
isSquare: {
|
|
@@ -26,24 +25,24 @@ const L = /* @__PURE__ */ g({
|
|
|
26
25
|
false: "rounded-full"
|
|
27
26
|
},
|
|
28
27
|
isEditable: {
|
|
29
|
-
true: "
|
|
30
|
-
false: "
|
|
28
|
+
true: "http-bg-gradient rounded-md border-1/2 border-r-1/2",
|
|
29
|
+
false: "cursor-auto"
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
}), E = a(() => o.value.short);
|
|
34
33
|
return (e, u) => e.isEditable ? (c(), y(t(x), {
|
|
35
34
|
key: 0,
|
|
36
|
-
modelValue:
|
|
37
|
-
"onUpdate:modelValue": u[0] || (u[0] = (S) =>
|
|
35
|
+
modelValue: i.value,
|
|
36
|
+
"onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
|
|
38
37
|
class: "mt-1 font-code text-sm uppercase",
|
|
39
|
-
options: t(
|
|
38
|
+
options: t(n)
|
|
40
39
|
}, {
|
|
41
40
|
default: q(() => [
|
|
42
41
|
s("div", {
|
|
43
42
|
class: l(["h-full", { "pointer-events-none": !e.isEditable }])
|
|
44
43
|
}, [
|
|
45
44
|
s("button", {
|
|
46
|
-
class: l(["relative h-full", t(
|
|
45
|
+
class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
47
46
|
type: "button"
|
|
48
47
|
}, [
|
|
49
48
|
s("span", null, p(E.value), 1)
|
|
@@ -53,11 +52,11 @@ const L = /* @__PURE__ */ g({
|
|
|
53
52
|
_: 1
|
|
54
53
|
}, 8, ["modelValue", "options"])) : (c(), w("div", {
|
|
55
54
|
key: 1,
|
|
56
|
-
class: l(["relative gap-1 whitespace-nowrap", t(
|
|
55
|
+
class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
57
56
|
type: "button"
|
|
58
57
|
}, p(o.value.short), 3));
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
60
|
export {
|
|
62
|
-
|
|
61
|
+
H as default
|
|
63
62
|
};
|
|
@@ -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":"AA2XA,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;;;;;;AAybF,wBAQG"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useUrlPrefetcher as
|
|
8
|
-
import { getOpenApiDocumentVersion as
|
|
9
|
-
import { isDocument as
|
|
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 { useWorkspace as
|
|
17
|
-
const
|
|
1
|
+
import { defineComponent as B, ref as q, computed as l, watch as y, onMounted as H, onUnmounted as R, openBlock as c, createBlock as W, unref as r, withCtx as K, createElementBlock as a, createCommentVNode as p, createElementVNode as e, normalizeClass as G, Fragment as _, createVNode as d, toDisplayString as J, createTextVNode as L } from "vue";
|
|
2
|
+
import Q from "../CommandPalette/WatchModeToggle.vue.js";
|
|
3
|
+
import X from "./ImportNowButton.vue.js";
|
|
4
|
+
import Y from "./IntegrationLogo.vue.js";
|
|
5
|
+
import Z from "./PrefetchError.vue.js";
|
|
6
|
+
import ee from "./WorkspaceSelector.vue.js";
|
|
7
|
+
import { useUrlPrefetcher as te } from "./hooks/useUrlPrefetcher.js";
|
|
8
|
+
import { getOpenApiDocumentVersion as M } from "./utils/getOpenApiDocumentVersion.js";
|
|
9
|
+
import { isDocument as A } from "./utils/isDocument.js";
|
|
10
|
+
import { isUrl as T } from "./utils/isUrl.js";
|
|
11
|
+
import { useActiveEntities as oe } from "../../store/active-entities.js";
|
|
12
|
+
import { useModal as se, ScalarModal as ne, ScalarIcon as ie } from "@scalar/components";
|
|
13
|
+
import { isLocalUrl as re } from "@scalar/oas-utils/helpers";
|
|
14
|
+
import { normalize as le } from "@scalar/openapi-parser";
|
|
15
|
+
import { getThemeStyles as ce } from "@scalar/themes";
|
|
16
|
+
import { useWorkspace as ae } from "../../store/store.js";
|
|
17
|
+
const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, ue = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "flex justify-center items-center mb-2 p-1"
|
|
20
|
-
},
|
|
20
|
+
}, pe = { class: "rounded-xl size-10" }, fe = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, ve = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, he = { class: "flex justify-center" }, xe = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, ye = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
|
|
23
|
-
},
|
|
23
|
+
}, _e = { class: "flex items-center justify-center" }, be = { class: "flex flex-col justify-center items-center pb-8" }, ge = { class: "text-center flex items-center flex-col" }, we = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ke = {
|
|
24
24
|
href: "https://scalar.com/download",
|
|
25
25
|
target: "_blank"
|
|
26
|
-
},
|
|
26
|
+
}, Ee = /* @__PURE__ */ B({
|
|
27
27
|
__name: "ImportCollectionModal",
|
|
28
28
|
props: {
|
|
29
29
|
source: {},
|
|
@@ -31,83 +31,84 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
|
|
|
31
31
|
eventType: {}
|
|
32
32
|
},
|
|
33
33
|
emits: ["importFinished"],
|
|
34
|
-
setup(
|
|
35
|
-
const o =
|
|
36
|
-
|
|
37
|
-
const
|
|
34
|
+
setup(U, { emit: P }) {
|
|
35
|
+
const o = U, C = P, { activeWorkspace: m } = oe(), { workspaceMutators: D, events: V } = ae(), { prefetchResult: n, prefetchUrl: b, resetPrefetchResult: S } = te(), i = se(), f = q(!0);
|
|
36
|
+
V.hotKeys.on(() => i.hide());
|
|
37
|
+
const j = l(() => {
|
|
38
38
|
try {
|
|
39
|
-
return
|
|
39
|
+
return le(
|
|
40
40
|
n.content || o.source || ""
|
|
41
41
|
);
|
|
42
42
|
} catch {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
}),
|
|
45
|
+
}), z = l(() => {
|
|
46
46
|
var s, t;
|
|
47
|
-
return (t = (s =
|
|
48
|
-
}),
|
|
49
|
-
() =>
|
|
47
|
+
return (t = (s = j.value) == null ? void 0 : s.info) == null ? void 0 : t.title;
|
|
48
|
+
}), g = l(
|
|
49
|
+
() => M(n.content || o.source || "")
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
y(
|
|
52
52
|
() => o.source,
|
|
53
53
|
async (s) => {
|
|
54
|
-
|
|
54
|
+
var t;
|
|
55
|
+
if (S(), T(s)) {
|
|
55
56
|
if (o.eventType && ["paste", "drop"].includes(o.eventType)) {
|
|
56
|
-
const { error: u } = await
|
|
57
|
+
const { error: u } = await b(
|
|
57
58
|
s,
|
|
58
|
-
m.value.proxyUrl
|
|
59
|
+
(t = m.value) == null ? void 0 : t.proxyUrl
|
|
59
60
|
);
|
|
60
61
|
u ? i.hide() : i.show();
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
b(s, m.value.proxyUrl), i.show();
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
|
-
s &&
|
|
67
|
+
s && A(s) && M(s) ? i.show() : i.hide();
|
|
67
68
|
}
|
|
68
69
|
);
|
|
69
|
-
const
|
|
70
|
-
document.body.classList.remove("has-no-import-url"), (
|
|
71
|
-
},
|
|
70
|
+
const N = l(() => !!o.source && T(o.source)), O = l(() => !!o.source && A(o.source)), v = l(() => n.url && re(n.url)), h = (s) => {
|
|
71
|
+
document.body.classList.remove("has-no-import-url"), (N.value || O.value) && i.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
72
|
+
}, $ = () => {
|
|
72
73
|
document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
|
|
73
74
|
};
|
|
74
|
-
|
|
75
|
+
y(
|
|
75
76
|
() => i.open,
|
|
76
77
|
(s) => {
|
|
77
|
-
s ? h() :
|
|
78
|
+
s ? h() : $();
|
|
78
79
|
}
|
|
79
|
-
),
|
|
80
|
+
), y(
|
|
80
81
|
() => o.source,
|
|
81
82
|
() => {
|
|
82
83
|
h();
|
|
83
84
|
}
|
|
84
|
-
),
|
|
85
|
+
), H(() => {
|
|
85
86
|
h();
|
|
86
|
-
}),
|
|
87
|
+
}), R(() => {
|
|
87
88
|
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
88
89
|
});
|
|
89
|
-
const
|
|
90
|
-
() => m.value && v.value && o.integration && `<style>${
|
|
90
|
+
const w = l(
|
|
91
|
+
() => m.value && v.value && o.integration && `<style>${ce(o.integration)}</style>`
|
|
91
92
|
);
|
|
92
|
-
function
|
|
93
|
-
v.value && o.integration &&
|
|
93
|
+
function E() {
|
|
94
|
+
v.value && o.integration && D.edit(
|
|
94
95
|
m.value.uid,
|
|
95
96
|
"themeId",
|
|
96
97
|
o.integration
|
|
97
|
-
),
|
|
98
|
+
), C("importFinished");
|
|
98
99
|
}
|
|
99
|
-
return (s, t) => (c(),
|
|
100
|
+
return (s, t) => (c(), W(r(ne), {
|
|
100
101
|
size: "full",
|
|
101
102
|
state: r(i)
|
|
102
103
|
}, {
|
|
103
|
-
default:
|
|
104
|
-
var u,
|
|
104
|
+
default: K(() => {
|
|
105
|
+
var x, u, k, I;
|
|
105
106
|
return [
|
|
106
|
-
|
|
107
|
+
w.value ? (c(), a("div", {
|
|
107
108
|
key: 0,
|
|
108
|
-
innerHTML:
|
|
109
|
-
}, null, 8,
|
|
110
|
-
e("div",
|
|
109
|
+
innerHTML: w.value
|
|
110
|
+
}, null, 8, de)) : p("", !0),
|
|
111
|
+
e("div", me, [
|
|
111
112
|
t[6] || (t[6] = e("div", { class: "section-flare" }, [
|
|
112
113
|
e("div", { class: "section-flare-item" }),
|
|
113
114
|
e("div", { class: "section-flare-item" }),
|
|
@@ -119,41 +120,41 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
|
|
|
119
120
|
e("div", { class: "section-flare-item" })
|
|
120
121
|
], -1)),
|
|
121
122
|
e("div", {
|
|
122
|
-
class:
|
|
123
|
+
class: G(["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(n).state === "loading" }])
|
|
123
124
|
}, [
|
|
124
|
-
r(n).error && r(n).state === "idle" && !
|
|
125
|
+
r(n).error && r(n).state === "idle" && !g.value ? (c(), a(_, { key: 0 }, [
|
|
125
126
|
t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
|
|
126
|
-
d(
|
|
127
|
-
url: ((
|
|
127
|
+
d(Z, {
|
|
128
|
+
url: ((x = r(n)) == null ? void 0 : x.input) || o.source
|
|
128
129
|
}, null, 8, ["url"])
|
|
129
|
-
], 64)) : (c(), a(
|
|
130
|
-
v.value ? (c(), a("div",
|
|
131
|
-
e("div",
|
|
132
|
-
d(
|
|
130
|
+
], 64)) : (c(), a(_, { key: 1 }, [
|
|
131
|
+
v.value ? (c(), a("div", ue, [
|
|
132
|
+
e("div", pe, [
|
|
133
|
+
d(Y, { integration: s.integration }, null, 8, ["integration"])
|
|
133
134
|
])
|
|
134
135
|
])) : p("", !0),
|
|
135
|
-
e("div",
|
|
136
|
+
e("div", fe, J(z.value || "Untitled Collection"), 1),
|
|
136
137
|
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)),
|
|
137
|
-
|
|
138
|
-
e("div",
|
|
139
|
-
d(
|
|
140
|
-
source: ((
|
|
138
|
+
g.value ? (c(), a(_, { key: 1 }, [
|
|
139
|
+
e("div", ve, [
|
|
140
|
+
d(X, {
|
|
141
|
+
source: ((u = r(n)) == null ? void 0 : u.url) ?? ((k = r(n)) == null ? void 0 : k.content) ?? s.source,
|
|
141
142
|
variant: "button",
|
|
142
143
|
watchMode: f.value,
|
|
143
|
-
onImportFinished:
|
|
144
|
+
onImportFinished: E
|
|
144
145
|
}, null, 8, ["source", "watchMode"])
|
|
145
146
|
]),
|
|
146
|
-
e("div",
|
|
147
|
-
e("div",
|
|
148
|
-
t[2] || (t[2] =
|
|
149
|
-
d(
|
|
147
|
+
e("div", he, [
|
|
148
|
+
e("div", xe, [
|
|
149
|
+
t[2] || (t[2] = L(" Import to: ")),
|
|
150
|
+
d(ee)
|
|
150
151
|
])
|
|
151
152
|
]),
|
|
152
|
-
(
|
|
153
|
-
e("div",
|
|
154
|
-
d(
|
|
153
|
+
(I = r(n)) != null && I.url ? (c(), a("div", ye, [
|
|
154
|
+
e("div", _e, [
|
|
155
|
+
d(Q, {
|
|
155
156
|
modelValue: f.value,
|
|
156
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
157
|
+
"onUpdate:modelValue": t[0] || (t[0] = (F) => f.value = F),
|
|
157
158
|
disableToolTip: !0
|
|
158
159
|
}, null, 8, ["modelValue"])
|
|
159
160
|
]),
|
|
@@ -162,11 +163,11 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
|
|
|
162
163
|
], 64)) : p("", !0)
|
|
163
164
|
], 64))
|
|
164
165
|
], 2),
|
|
165
|
-
e("div",
|
|
166
|
-
e("div",
|
|
167
|
-
e("div",
|
|
168
|
-
e("a",
|
|
169
|
-
d(r(
|
|
166
|
+
e("div", be, [
|
|
167
|
+
e("div", ge, [
|
|
168
|
+
e("div", we, [
|
|
169
|
+
e("a", ke, [
|
|
170
|
+
d(r(ie), {
|
|
170
171
|
icon: "Logo",
|
|
171
172
|
size: "xl"
|
|
172
173
|
})
|
|
@@ -179,7 +180,7 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
|
|
|
179
180
|
target: "_blank"
|
|
180
181
|
}, " Download Desktop App "),
|
|
181
182
|
e("br"),
|
|
182
|
-
|
|
183
|
+
L(" free · open-source · offline first ")
|
|
183
184
|
], -1))
|
|
184
185
|
])
|
|
185
186
|
])
|
|
@@ -191,5 +192,5 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
|
|
|
191
192
|
}
|
|
192
193
|
});
|
|
193
194
|
export {
|
|
194
|
-
|
|
195
|
+
Ee as default
|
|
195
196
|
};
|
|
@@ -4,7 +4,7 @@ import { useActiveEntities as B } from "../../store/active-entities.js";
|
|
|
4
4
|
import { ScalarButton as l } from "@scalar/components";
|
|
5
5
|
import { useToasts as F } from "@scalar/use-toasts";
|
|
6
6
|
import { useRouter as I } from "vue-router";
|
|
7
|
-
import { useWorkspace as
|
|
7
|
+
import { useWorkspace as U } from "../../store/store.js";
|
|
8
8
|
const R = /* @__PURE__ */ v({
|
|
9
9
|
__name: "ImportNowButton",
|
|
10
10
|
props: {
|
|
@@ -14,7 +14,7 @@ const R = /* @__PURE__ */ v({
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["importFinished"],
|
|
16
16
|
setup(f, { emit: d }) {
|
|
17
|
-
const o = f, y = d, k = I(), { activeWorkspace: r } = B(), { importSpecFromUrl: w, importSpecFile: h } =
|
|
17
|
+
const o = f, y = d, k = I(), { activeWorkspace: r } = B(), { importSpecFromUrl: w, importSpecFile: h } = U(), { toast: i } = F();
|
|
18
18
|
async function n() {
|
|
19
19
|
try {
|
|
20
20
|
if (o.source) {
|
|
@@ -23,7 +23,7 @@ const R = /* @__PURE__ */ v({
|
|
|
23
23
|
o.source,
|
|
24
24
|
r.value.uid,
|
|
25
25
|
{
|
|
26
|
-
|
|
26
|
+
proxyUrl: r.value.proxyUrl,
|
|
27
27
|
watchMode: o.watchMode
|
|
28
28
|
}
|
|
29
29
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AA2bA,wBAKG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as y, ref as W, openBlock as
|
|
1
|
+
import { defineComponent as y, ref as W, openBlock as m, createElementBlock as x, Fragment as w, createElementVNode as t, createVNode as s, unref as e, withCtx as a, renderList as D, createBlock as N, withModifiers as k, normalizeClass as z, toDisplayString as v, withDirectives as M, vModelText as B, createTextVNode as V } from "vue";
|
|
2
2
|
import { useActiveEntities as j } from "../../store/active-entities.js";
|
|
3
|
-
import { useModal as E, ScalarDropdown as T, ScalarDropdownItem as
|
|
3
|
+
import { useModal as E, ScalarDropdown as T, ScalarDropdownItem as h, ScalarIcon as d, ScalarDropdownDivider as $, ScalarButton as _, ScalarModal as A } from "@scalar/components";
|
|
4
4
|
import { useToasts as I } from "@scalar/use-toasts";
|
|
5
5
|
import { useRouter as F } from "vue-router";
|
|
6
6
|
import { useWorkspace as L } from "../../store/store.js";
|
|
@@ -29,63 +29,61 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
|
|
|
29
29
|
}
|
|
30
30
|
}), r.value = "", c.hide();
|
|
31
31
|
};
|
|
32
|
-
return (n,
|
|
32
|
+
return (n, o) => (m(), x(w, null, [
|
|
33
33
|
t("div", P, [
|
|
34
34
|
s(e(T), null, {
|
|
35
|
-
items:
|
|
36
|
-
(
|
|
35
|
+
items: a(() => [
|
|
36
|
+
(m(!0), x(w, null, D(e(b), (l, p) => (m(), N(e(h), {
|
|
37
37
|
key: p,
|
|
38
38
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
|
|
39
39
|
onClick: k((J) => C(p), ["stop"])
|
|
40
40
|
}, {
|
|
41
|
-
default:
|
|
41
|
+
default: a(() => [
|
|
42
42
|
t("div", {
|
|
43
|
-
class:
|
|
43
|
+
class: z([
|
|
44
44
|
"flex items-center justify-center rounded-full p-[3px] w-4 h-4",
|
|
45
45
|
e(i).uid === p ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
|
|
46
46
|
])
|
|
47
47
|
}, [
|
|
48
|
-
s(e(
|
|
48
|
+
s(e(d), {
|
|
49
49
|
class: "size-2.5",
|
|
50
50
|
icon: "Checkmark",
|
|
51
51
|
thickness: "3.5"
|
|
52
52
|
})
|
|
53
53
|
], 2),
|
|
54
|
-
t("span", q,
|
|
54
|
+
t("span", q, v(l.name), 1)
|
|
55
55
|
]),
|
|
56
56
|
_: 2
|
|
57
57
|
}, 1032, ["onClick"]))), 128)),
|
|
58
58
|
s(e($)),
|
|
59
|
-
s(e(
|
|
59
|
+
s(e(h), {
|
|
60
60
|
class: "flex items-center gap-1.5",
|
|
61
|
-
onClick:
|
|
61
|
+
onClick: o[0] || (o[0] = (l) => e(c).show())
|
|
62
62
|
}, {
|
|
63
|
-
default:
|
|
63
|
+
default: a(() => [
|
|
64
64
|
t("div", G, [
|
|
65
|
-
s(e(
|
|
66
|
-
class: "h-2.5",
|
|
65
|
+
s(e(d), {
|
|
67
66
|
icon: "Add",
|
|
68
|
-
|
|
67
|
+
size: "sm"
|
|
69
68
|
})
|
|
70
69
|
]),
|
|
71
|
-
|
|
70
|
+
o[2] || (o[2] = t("span", null, "New Workspace", -1))
|
|
72
71
|
]),
|
|
73
72
|
_: 1
|
|
74
73
|
})
|
|
75
74
|
]),
|
|
76
|
-
default:
|
|
75
|
+
default: a(() => [
|
|
77
76
|
s(e(_), {
|
|
78
77
|
class: "font-normal h-full justify-start line-clamp-1 py-1 px-1.5 text-c-1 hover:bg-b-2 w-fit text-c-3",
|
|
79
78
|
fullWidth: "",
|
|
80
79
|
variant: "ghost"
|
|
81
80
|
}, {
|
|
82
|
-
default:
|
|
81
|
+
default: a(() => [
|
|
83
82
|
t("div", R, [
|
|
84
|
-
t("h2", U,
|
|
85
|
-
s(e(
|
|
86
|
-
class: "size-3",
|
|
83
|
+
t("h2", U, v(e(i).name), 1),
|
|
84
|
+
s(e(d), {
|
|
87
85
|
icon: "ChevronDown",
|
|
88
|
-
|
|
86
|
+
size: "md"
|
|
89
87
|
})
|
|
90
88
|
])
|
|
91
89
|
]),
|
|
@@ -101,13 +99,13 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
|
|
|
101
99
|
state: e(c),
|
|
102
100
|
variant: "form"
|
|
103
101
|
}, {
|
|
104
|
-
default:
|
|
102
|
+
default: a(() => [
|
|
105
103
|
t("form", {
|
|
106
104
|
class: "flex gap-1 rounded",
|
|
107
105
|
onSubmit: k(S, ["prevent"])
|
|
108
106
|
}, [
|
|
109
|
-
|
|
110
|
-
"onUpdate:modelValue":
|
|
107
|
+
M(t("input", {
|
|
108
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => r.value = l),
|
|
111
109
|
class: "border-none outline-none flex-1 w-full text-sm min-h-8 p-1.5",
|
|
112
110
|
placeholder: "New Workspace",
|
|
113
111
|
type: "text"
|
|
@@ -119,7 +117,7 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
|
|
|
119
117
|
disabled: !r.value.trim(),
|
|
120
118
|
type: "submit"
|
|
121
119
|
}, {
|
|
122
|
-
default:
|
|
120
|
+
default: a(() => o[3] || (o[3] = [
|
|
123
121
|
V(" Continue ")
|
|
124
122
|
])),
|
|
125
123
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
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;;
|
|
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;;yBAuHX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBjB"}
|
|
@@ -2,7 +2,7 @@ import { resolve as i } from "@scalar/import";
|
|
|
2
2
|
import { redirectToProxy as f, fetchWithProxyFallback as d } from "@scalar/oas-utils/helpers";
|
|
3
3
|
import { reactive as h } from "vue";
|
|
4
4
|
import { isUrl as m } from "../../../libs/isUrl.js";
|
|
5
|
-
function
|
|
5
|
+
function y() {
|
|
6
6
|
const n = h({
|
|
7
7
|
state: "idle",
|
|
8
8
|
content: null,
|
|
@@ -19,40 +19,45 @@ function b() {
|
|
|
19
19
|
error: null
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
async function s(
|
|
23
|
-
if (!
|
|
22
|
+
async function s(e, r) {
|
|
23
|
+
if (!e)
|
|
24
24
|
return {
|
|
25
25
|
state: "idle",
|
|
26
26
|
content: null,
|
|
27
27
|
url: null,
|
|
28
|
-
input:
|
|
28
|
+
input: e,
|
|
29
29
|
error: null
|
|
30
30
|
};
|
|
31
31
|
try {
|
|
32
|
-
const
|
|
32
|
+
const t = await i(e, {
|
|
33
33
|
fetch: (c) => fetch(r ? f(r, c) : c, {
|
|
34
34
|
cache: "no-cache"
|
|
35
35
|
})
|
|
36
36
|
});
|
|
37
|
-
if (typeof
|
|
38
|
-
return {
|
|
39
|
-
|
|
37
|
+
if (typeof t == "object" && t !== null)
|
|
38
|
+
return {
|
|
39
|
+
state: "idle",
|
|
40
|
+
content: JSON.stringify(t, null, 2),
|
|
41
|
+
url: null,
|
|
42
|
+
error: null
|
|
43
|
+
};
|
|
44
|
+
if (t === void 0)
|
|
40
45
|
return {
|
|
41
46
|
state: "idle",
|
|
42
47
|
content: null,
|
|
43
48
|
url: null,
|
|
44
|
-
input:
|
|
45
|
-
error: `Could not find an OpenAPI document in ${
|
|
49
|
+
input: e,
|
|
50
|
+
error: `Could not find an OpenAPI document in ${e}`
|
|
46
51
|
};
|
|
47
|
-
if (!m(
|
|
52
|
+
if (!m(t))
|
|
48
53
|
return {
|
|
49
54
|
state: "idle",
|
|
50
55
|
content: null,
|
|
51
56
|
url: null,
|
|
52
|
-
input:
|
|
57
|
+
input: e,
|
|
53
58
|
error: "Oops, we got invalid content for the given URL."
|
|
54
59
|
};
|
|
55
|
-
const o =
|
|
60
|
+
const o = t, l = await d(o, {
|
|
56
61
|
proxy: r,
|
|
57
62
|
cache: "no-cache"
|
|
58
63
|
});
|
|
@@ -65,29 +70,29 @@ function b() {
|
|
|
65
70
|
state: "idle",
|
|
66
71
|
content: null,
|
|
67
72
|
url: null,
|
|
68
|
-
input:
|
|
73
|
+
input: e,
|
|
69
74
|
error: `Couldn't fetch ${o}, got error ${[l.status, l.statusText].join(" ").trim()}.`
|
|
70
75
|
};
|
|
71
|
-
} catch (
|
|
72
|
-
return console.error("[prefetchDocument]",
|
|
76
|
+
} catch (t) {
|
|
77
|
+
return console.error("[prefetchDocument]", t), {
|
|
73
78
|
state: "idle",
|
|
74
79
|
content: null,
|
|
75
80
|
url: null,
|
|
76
|
-
input:
|
|
77
|
-
error:
|
|
81
|
+
input: e,
|
|
82
|
+
error: t.message
|
|
78
83
|
};
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
|
-
async function a(
|
|
86
|
+
async function a(e, r) {
|
|
82
87
|
Object.assign(n, {
|
|
83
88
|
state: "loading",
|
|
84
89
|
content: null,
|
|
85
90
|
url: null,
|
|
86
|
-
input:
|
|
91
|
+
input: e,
|
|
87
92
|
error: null
|
|
88
93
|
});
|
|
89
|
-
const
|
|
90
|
-
return Object.assign(n,
|
|
94
|
+
const t = await s(e, r);
|
|
95
|
+
return Object.assign(n, t), t;
|
|
91
96
|
}
|
|
92
97
|
return {
|
|
93
98
|
prefetchResult: n,
|
|
@@ -96,5 +101,5 @@ function b() {
|
|
|
96
101
|
};
|
|
97
102
|
}
|
|
98
103
|
export {
|
|
99
|
-
|
|
104
|
+
y as useUrlPrefetcher
|
|
100
105
|
};
|