@scalar/api-client 2.1.34 → 2.1.36
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 +30 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +105 -119
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +14 -14
- package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts +15 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue.js +39 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue2.js +4 -0
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +1 -1
- package/dist/components/ContextBar.vue2.js +6 -6
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +53 -40
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +39 -33
- package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -20
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +2 -0
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +159 -100
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +5 -0
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts +2 -0
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +35 -31
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +7 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +46 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue2.js +4 -0
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts +8 -0
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -0
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +2 -2
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +7 -7
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +2 -2
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +29 -12
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +34 -42
- package/dist/components/OpenApiClientButton.vue.d.ts +13 -0
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -0
- package/dist/components/OpenApiClientButton.vue.js +7 -0
- package/dist/components/OpenApiClientButton.vue2.js +36 -0
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue2.js +8 -8
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +14 -14
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -2
- package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
- package/dist/layouts/App/MainLayout.vue.js +4 -4
- package/dist/layouts/App/create-api-client-app.d.ts +58 -41
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +116 -82
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +42 -38
- package/dist/layouts/Web/create-api-client-web.d.ts +58 -41
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +58 -41
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/store/collections.d.ts +34 -24
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/import-spec.d.ts +6 -4
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/store.d.ts +116 -82
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue2.js +30 -31
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +21 -21
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +79 -71
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +24 -24
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +8 -8
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -124
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +126 -0
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +29 -29
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +2 -2
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +47 -47
- 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 +67 -42
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +5 -99
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +104 -2
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.js +24 -24
- package/dist/views/Request/types/sidebar-item.d.ts +1 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as V, ref as
|
|
2
|
-
import
|
|
3
|
-
import { ScalarIconButton as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "text-c-2 flex min-w-[120px] items-center border-r-1/2 pl-2 pr-0"
|
|
9
|
-
}, I = { class: "row-1" }, O = {
|
|
1
|
+
import { defineComponent as V, ref as i, computed as k, openBlock as l, createBlock as u, normalizeClass as b, withCtx as g, createElementBlock as r, renderSlot as p, createCommentVNode as d, createElementVNode as C, Fragment as B, mergeProps as y, unref as $ } from "vue";
|
|
2
|
+
import h from "../CodeInput/CodeInput.vue.js";
|
|
3
|
+
import { ScalarIconButton as x } from "@scalar/components";
|
|
4
|
+
import O from "./DataTableCell.vue.js";
|
|
5
|
+
import q from "./DataTableInputSelect.vue.js";
|
|
6
|
+
const A = {
|
|
10
7
|
key: 0,
|
|
8
|
+
class: "text-c-1 flex min-w-[94px] items-center pl-2 pr-0"
|
|
9
|
+
}, I = { class: "row-1 overflow-x-auto" }, E = ["id", "readOnly", "type", "value"], F = {
|
|
10
|
+
key: 2,
|
|
11
11
|
class: "absolute centered-y right-0 pt-px pr-2 text-xxs text-c-3 bg-b-1 shadow-[-8px_0_4px_var(--scalar-background-1)] opacity-100 duration-150 transition-opacity peer-focus:opacity-0"
|
|
12
12
|
}, S = {
|
|
13
13
|
key: 1,
|
|
@@ -28,30 +28,43 @@ const F = {
|
|
|
28
28
|
max: {}
|
|
29
29
|
},
|
|
30
30
|
emits: ["update:modelValue", "inputFocus", "inputBlur", "selectVariable"],
|
|
31
|
-
setup(
|
|
32
|
-
const o =
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
() => o.type === "password" ?
|
|
31
|
+
setup(c, { emit: f }) {
|
|
32
|
+
const o = c, s = f, n = i(!0);
|
|
33
|
+
i("");
|
|
34
|
+
const v = i(!1), w = () => {
|
|
35
|
+
v.value || s("inputBlur");
|
|
36
|
+
}, m = k(
|
|
37
|
+
() => o.type === "password" ? n.value ? "password" : "text" : o.type ?? "text"
|
|
38
38
|
);
|
|
39
|
-
return (e, t) => (l(),
|
|
39
|
+
return (e, t) => (l(), u(O, {
|
|
40
40
|
class: b(["relative row", e.containerClass])
|
|
41
41
|
}, {
|
|
42
|
-
default:
|
|
43
|
-
e.$slots.default ? (l(),
|
|
44
|
-
|
|
45
|
-
])) :
|
|
42
|
+
default: g(() => [
|
|
43
|
+
e.$slots.default ? (l(), r("div", A, [
|
|
44
|
+
p(e.$slots, "default", {}, void 0, !0)
|
|
45
|
+
])) : d("", !0),
|
|
46
46
|
C("div", I, [
|
|
47
|
-
o.enum && o.enum.length ? (l(),
|
|
47
|
+
o.enum && o.enum.length ? (l(), u(q, {
|
|
48
48
|
key: 0,
|
|
49
49
|
canAddCustomValue: e.canAddCustomEnumValue,
|
|
50
50
|
modelValue: o.modelValue,
|
|
51
51
|
value: o.enum,
|
|
52
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
53
|
-
}, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (l(),
|
|
54
|
-
|
|
52
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => s("update:modelValue", a))
|
|
53
|
+
}, null, 8, ["canAddCustomValue", "modelValue", "value"])) : (l(), r(B, { key: 1 }, [
|
|
54
|
+
n.value && e.type === "password" ? (l(), r("input", y({ key: 0 }, e.$attrs, {
|
|
55
|
+
id: e.id,
|
|
56
|
+
autocomplete: "off",
|
|
57
|
+
class: "border-none text-c-1 disabled:text-c-2 min-w-0 w-full peer px-2 py-1.25 outline-none",
|
|
58
|
+
"data-1p-ignore": "",
|
|
59
|
+
readOnly: e.readOnly,
|
|
60
|
+
spellcheck: "false",
|
|
61
|
+
type: m.value,
|
|
62
|
+
value: e.modelValue,
|
|
63
|
+
onInput: t[1] || (t[1] = (a) => s(
|
|
64
|
+
"update:modelValue",
|
|
65
|
+
a.target.value ?? ""
|
|
66
|
+
))
|
|
67
|
+
}), null, 16, E)) : (l(), u(h, y({ key: 1 }, e.$attrs, {
|
|
55
68
|
id: e.id,
|
|
56
69
|
class: "border-none text-c-1 disabled:text-c-2 min-w-0 w-full peer outline-none",
|
|
57
70
|
disableCloseBrackets: "",
|
|
@@ -62,25 +75,25 @@ const F = {
|
|
|
62
75
|
readOnly: e.readOnly,
|
|
63
76
|
required: e.required,
|
|
64
77
|
spellcheck: "false",
|
|
65
|
-
type:
|
|
66
|
-
onBlur:
|
|
67
|
-
onFocus: t[
|
|
68
|
-
"onUpdate:modelValue": t[
|
|
69
|
-
}), null, 16, ["id", "max", "min", "modelValue", "readOnly", "required", "type"]),
|
|
70
|
-
e.required ? (l(),
|
|
78
|
+
type: m.value,
|
|
79
|
+
onBlur: w,
|
|
80
|
+
onFocus: t[2] || (t[2] = (a) => s("inputFocus")),
|
|
81
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => s("update:modelValue", a))
|
|
82
|
+
}), null, 16, ["id", "max", "min", "modelValue", "readOnly", "required", "type"])),
|
|
83
|
+
e.required ? (l(), r("div", F, " Required ")) : d("", !0)
|
|
71
84
|
], 64))
|
|
72
85
|
]),
|
|
73
|
-
e.$slots.warning ? (l(),
|
|
74
|
-
|
|
75
|
-
])) :
|
|
76
|
-
|
|
77
|
-
e.type === "password" ? (l(),
|
|
86
|
+
e.$slots.warning ? (l(), r("div", S, [
|
|
87
|
+
p(e.$slots, "warning", {}, void 0, !0)
|
|
88
|
+
])) : d("", !0),
|
|
89
|
+
p(e.$slots, "icon", {}, void 0, !0),
|
|
90
|
+
e.type === "password" ? (l(), u($(x), {
|
|
78
91
|
key: 2,
|
|
79
92
|
class: "-ml-.5 mr-1 h-6 w-6 self-center p-1.5",
|
|
80
|
-
icon:
|
|
81
|
-
label:
|
|
82
|
-
onClick: t[
|
|
83
|
-
}, null, 8, ["icon", "label"])) :
|
|
93
|
+
icon: n.value ? "Show" : "Hide",
|
|
94
|
+
label: n.value ? "Show Password" : "Hide Password",
|
|
95
|
+
onClick: t[4] || (t[4] = (a) => n.value = !n.value)
|
|
96
|
+
}, null, 8, ["icon", "label"])) : d("", !0)
|
|
84
97
|
]),
|
|
85
98
|
_: 3
|
|
86
99
|
}, 8, ["class"]));
|
|
@@ -84,7 +84,7 @@ const W = { class: "font-medium m-0 text-xs flex gap-1.5 items-center whitespace
|
|
|
84
84
|
]),
|
|
85
85
|
default: r(() => [
|
|
86
86
|
n(e(I), {
|
|
87
|
-
class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 text-c-
|
|
87
|
+
class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 text-c-1 w-fit",
|
|
88
88
|
fullWidth: "",
|
|
89
89
|
variant: "ghost"
|
|
90
90
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;AAkVA,wBAQG"}
|
|
@@ -1,70 +1,76 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as g, ref as y, onMounted as x, onBeforeUnmount as h, openBlock as p, createBlock as D, Transition as E, withCtx as T, createElementBlock as _, createElementVNode as i, createVNode as L, unref as C, createCommentVNode as b } from "vue";
|
|
2
|
+
import { ScalarIcon as k } from "@scalar/components";
|
|
3
|
+
const A = {
|
|
4
4
|
key: 0,
|
|
5
|
-
class: "fixed bottom-10 right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
|
|
6
|
-
}, w = { class: "flex flex-col items-center justify-center h-full" }, V = /* @__PURE__ */
|
|
5
|
+
class: "fixed translate-x-1/2 translate-y-1/2 md:translate-x-0 md:translate-y-0 right-1/2 bottom-1/2 md:bottom-10 md:right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
|
|
6
|
+
}, w = { class: "flex flex-col items-center justify-center h-full" }, V = /* @__PURE__ */ g({
|
|
7
7
|
__name: "DropEventListener",
|
|
8
8
|
emits: ["input"],
|
|
9
|
-
setup(
|
|
10
|
-
const d =
|
|
9
|
+
setup(B, { emit: v }) {
|
|
10
|
+
const d = v, r = y(!1);
|
|
11
11
|
let o = 0;
|
|
12
|
-
|
|
13
|
-
document.addEventListener("dragenter",
|
|
12
|
+
x(() => {
|
|
13
|
+
document.addEventListener("dragenter", m), document.addEventListener("dragleave", f), document.addEventListener("dragover", u), document.addEventListener("drop", c);
|
|
14
14
|
}), h(() => {
|
|
15
|
-
document.removeEventListener("dragenter",
|
|
15
|
+
document.removeEventListener("dragenter", m), document.removeEventListener("dragover", u), document.removeEventListener("dragleave", f), document.removeEventListener("drop", c);
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
function l(e) {
|
|
18
|
+
var t;
|
|
19
|
+
return ((t = e.dataTransfer) == null ? void 0 : t.types.includes("text/html")) ?? !1;
|
|
20
|
+
}
|
|
21
|
+
async function c(e) {
|
|
22
|
+
if (e.preventDefault(), r.value = !1, o = 0, !l(e) && e.dataTransfer) {
|
|
19
23
|
const t = e.dataTransfer.getData("text").replace(/^blob:/, "");
|
|
20
24
|
if (t)
|
|
21
25
|
d("input", t);
|
|
22
26
|
else if (e.dataTransfer.files.length > 0) {
|
|
23
27
|
const a = e.dataTransfer.files[0], n = new FileReader();
|
|
24
|
-
n.onload = async (
|
|
25
|
-
|
|
28
|
+
n.onload = async (s) => {
|
|
29
|
+
s.target && typeof s.target.result == "string" && d("input", s.target.result);
|
|
26
30
|
}, n.readAsText(a);
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
function
|
|
34
|
+
function u(e) {
|
|
31
35
|
e.preventDefault();
|
|
32
36
|
}
|
|
33
|
-
function
|
|
37
|
+
function f(e) {
|
|
34
38
|
e.preventDefault(), o--, o === 0 && (r.value = !1);
|
|
35
39
|
}
|
|
36
|
-
function
|
|
37
|
-
if (e.preventDefault(), o++, e
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
function m(e) {
|
|
41
|
+
if (e.preventDefault(), o++, !l(e)) {
|
|
42
|
+
if (e.dataTransfer) {
|
|
43
|
+
const t = e.dataTransfer.items;
|
|
44
|
+
for (let a = 0; a < t.length; a++) {
|
|
45
|
+
const n = t[a];
|
|
46
|
+
if (n.kind === "string" || n.type.includes("json") || n.type.includes("yml") || n.type.includes("yaml")) {
|
|
47
|
+
r.value = !0;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
44
50
|
}
|
|
45
51
|
}
|
|
52
|
+
r.value = !1;
|
|
46
53
|
}
|
|
47
|
-
r.value = !1;
|
|
48
54
|
}
|
|
49
|
-
return (e, t) => (
|
|
55
|
+
return (e, t) => (p(), D(E, {
|
|
50
56
|
enterActiveClass: "transition-opacity duration-200",
|
|
51
57
|
enterFromClass: "opacity-0",
|
|
52
58
|
leaveActiveClass: "transition-opacity duration-200",
|
|
53
59
|
leaveToClass: "opacity-0"
|
|
54
60
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
r.value ? (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
L(
|
|
61
|
+
default: T(() => [
|
|
62
|
+
r.value ? (p(), _("div", A, [
|
|
63
|
+
i("div", w, [
|
|
64
|
+
i("div", null, [
|
|
65
|
+
L(C(k), {
|
|
60
66
|
icon: "Download",
|
|
61
67
|
size: "xl",
|
|
62
68
|
thickness: "2"
|
|
63
69
|
})
|
|
64
70
|
]),
|
|
65
|
-
t[0] || (t[0] =
|
|
71
|
+
t[0] || (t[0] = i("div", { class: "text-center text-c-1 m-4" }, " Drop your OpenAPI document here ", -1))
|
|
66
72
|
])
|
|
67
|
-
])) :
|
|
73
|
+
])) : b("", !0)
|
|
68
74
|
]),
|
|
69
75
|
_: 1
|
|
70
76
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportCollectionListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionListener.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImportCollectionListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionListener.vue"],"names":[],"mappings":"AA0FA,iBAAS,cAAc;qBA4GO,GAAG;EAqBhC;AACD,QAAA,MAAM,eAAe,+QAKnB,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,30 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as u, ref as i, openBlock as c, createElementBlock as m, Fragment as s, createVNode as n, renderSlot as p, nextTick as f } from "vue";
|
|
2
|
+
import _ from "./DropEventListener.vue.js";
|
|
3
|
+
import d from "./ImportCollectionModal.vue.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import v from "./PasteEventListener.vue.js";
|
|
6
|
+
import I from "./UrlQueryParameterChecker.vue.js";
|
|
7
|
+
const B = /* @__PURE__ */ u({
|
|
7
8
|
__name: "ImportCollectionListener",
|
|
8
|
-
setup(
|
|
9
|
-
const e =
|
|
10
|
-
async function
|
|
11
|
-
e.value = null, await
|
|
9
|
+
setup($) {
|
|
10
|
+
const e = i(null), t = i(null);
|
|
11
|
+
async function a() {
|
|
12
|
+
e.value = null, t.value = null, await f();
|
|
12
13
|
}
|
|
13
|
-
async function o(
|
|
14
|
-
await
|
|
14
|
+
async function o(r, l = null) {
|
|
15
|
+
await a(), e.value = r, t.value = l;
|
|
15
16
|
}
|
|
16
|
-
return (
|
|
17
|
-
n(
|
|
17
|
+
return (r, l) => (c(), m(s, null, [
|
|
18
|
+
n(d, {
|
|
19
|
+
integration: t.value,
|
|
18
20
|
source: e.value,
|
|
19
|
-
onImportFinished:
|
|
20
|
-
}, null, 8, ["source"]),
|
|
21
|
+
onImportFinished: a
|
|
22
|
+
}, null, 8, ["integration", "source"]),
|
|
23
|
+
n(v, { onInput: o }),
|
|
21
24
|
n(_, { onInput: o }),
|
|
22
|
-
n(
|
|
23
|
-
|
|
24
|
-
i(t.$slots, "default")
|
|
25
|
+
n(I, { onInput: o }),
|
|
26
|
+
p(r.$slots, "default")
|
|
25
27
|
], 64));
|
|
26
28
|
}
|
|
27
29
|
});
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
B as default
|
|
30
32
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
source: string | null;
|
|
3
|
+
integration: string | null;
|
|
3
4
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
5
|
importFinished: () => any;
|
|
5
6
|
}, string, import("vue").PublicProps, Readonly<{
|
|
6
7
|
source: string | null;
|
|
8
|
+
integration: string | null;
|
|
7
9
|
}> & Readonly<{
|
|
8
10
|
onImportFinished?: (() => any) | undefined;
|
|
9
11
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -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":";YAiVU,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;YADlB,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;AA+b5B,wBASG"}
|
|
@@ -1,119 +1,178 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
1
|
+
import { defineComponent as K, ref as w, computed as c, watch as u, onMounted as R, onUnmounted as G, resolveComponent as H, openBlock as a, createBlock as p, unref as s, withCtx as k, createElementVNode as e, normalizeClass as J, createCommentVNode as f, toDisplayString as I, createElementBlock as x, Fragment as Q, createVNode as i, createTextVNode as C } from "vue";
|
|
2
|
+
import X from "../CommandPalette/WatchModeToggle.vue.js";
|
|
3
|
+
import { useUrlPrefetcher as Y } from "./hooks/useUrlPrefetcher.js";
|
|
4
|
+
import { getOpenApiDocumentVersion as M } from "./utils/getOpenApiDocumentVersion.js";
|
|
5
|
+
import { isDocument as A } from "./utils/isDocument.js";
|
|
6
|
+
import { isUrl as h } from "./utils/isUrl.js";
|
|
7
|
+
import { useModal as U, ScalarModal as L, ScalarIcon as P, ScalarCodeBlock as Z } from "@scalar/components";
|
|
8
|
+
import { isLocalUrl as ee } from "@scalar/oas-utils/helpers";
|
|
9
|
+
import { normalize as te } from "@scalar/openapi-parser";
|
|
10
|
+
import oe from "./ImportNowButton.vue.js";
|
|
11
|
+
import se from "./IntegrationLogo.vue.js";
|
|
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 = {
|
|
12
15
|
key: 0,
|
|
13
|
-
class: "
|
|
14
|
-
},
|
|
15
|
-
key:
|
|
16
|
-
class: "
|
|
17
|
-
},
|
|
16
|
+
class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
|
|
17
|
+
}, ue = { class: "flex items-center justify-center" }, pe = {
|
|
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 = {
|
|
21
|
+
href: "https://scalar.com/download",
|
|
22
|
+
target: "_blank"
|
|
23
|
+
}, be = { class: "text-sm" }, De = /* @__PURE__ */ K({
|
|
18
24
|
__name: "ImportCollectionModal",
|
|
19
25
|
props: {
|
|
20
|
-
source: {}
|
|
26
|
+
source: {},
|
|
27
|
+
integration: {}
|
|
21
28
|
},
|
|
22
29
|
emits: ["importFinished"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
30
|
+
setup(S) {
|
|
31
|
+
const n = S, { activeWorkspace: V, events: z } = ne(), { prefetchResult: r, prefetchUrl: D } = Y(), l = U(), E = U(), j = w(""), d = w(!0);
|
|
32
|
+
z.hotKeys.on(() => l.hide());
|
|
33
|
+
const B = c(() => {
|
|
27
34
|
try {
|
|
28
|
-
return
|
|
29
|
-
r.content ||
|
|
35
|
+
return te(
|
|
36
|
+
r.content || n.source || ""
|
|
30
37
|
);
|
|
31
38
|
} catch {
|
|
32
39
|
return;
|
|
33
40
|
}
|
|
34
|
-
}),
|
|
35
|
-
var
|
|
36
|
-
return (
|
|
37
|
-
}),
|
|
38
|
-
() =>
|
|
41
|
+
}), N = c(() => {
|
|
42
|
+
var o, t;
|
|
43
|
+
return (t = (o = B.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
|
|
44
|
+
}), v = c(
|
|
45
|
+
() => M(r.content || n.source || "")
|
|
39
46
|
);
|
|
40
|
-
|
|
41
|
-
() =>
|
|
42
|
-
(
|
|
43
|
-
|
|
47
|
+
u(
|
|
48
|
+
() => n.source,
|
|
49
|
+
(o) => {
|
|
50
|
+
h(o) && D(o, V.value.proxyUrl), o && (h(o) || A(o) && M(o)) ? l.show() : l.hide();
|
|
44
51
|
}
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
])
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
52
|
+
);
|
|
53
|
+
const $ = c(() => !!n.source && h(n.source)), F = c(() => !!n.source && A(n.source)), O = c(() => r.url && ee(r.url)), m = (o) => {
|
|
54
|
+
($.value || F.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
55
|
+
}, T = () => {
|
|
56
|
+
document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
|
|
57
|
+
};
|
|
58
|
+
return u(
|
|
59
|
+
() => l.open,
|
|
60
|
+
(o) => {
|
|
61
|
+
o ? m() : T();
|
|
62
|
+
}
|
|
63
|
+
), u(
|
|
64
|
+
() => n.source,
|
|
65
|
+
() => {
|
|
66
|
+
m();
|
|
67
|
+
}
|
|
68
|
+
), R(() => {
|
|
69
|
+
m();
|
|
70
|
+
}), G(() => {
|
|
71
|
+
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
72
|
+
}), (o, t) => {
|
|
73
|
+
const q = H("PrefetchError");
|
|
74
|
+
return a(), p(s(L), {
|
|
75
|
+
size: "full",
|
|
76
|
+
state: s(l)
|
|
77
|
+
}, {
|
|
78
|
+
default: k(() => {
|
|
79
|
+
var _, y, b, g;
|
|
80
|
+
return [
|
|
81
|
+
e("div", le, [
|
|
82
|
+
e("div", {
|
|
83
|
+
class: J(["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": s(r).state === "loading" }])
|
|
84
|
+
}, [
|
|
85
|
+
O.value ? (a(), p(se, {
|
|
86
|
+
key: 0,
|
|
87
|
+
integration: o.integration
|
|
88
|
+
}, null, 8, ["integration"])) : f("", !0),
|
|
89
|
+
e("div", ie, I(N.value ?? "Untitled Collection"), 1),
|
|
90
|
+
t[5] || (t[5] = e("div", { class: "text-c-1 text-sm font-medium mb-2 text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
|
|
91
|
+
s(r).error ? (a(), p(q, {
|
|
92
|
+
key: 1,
|
|
93
|
+
result: s(r)
|
|
94
|
+
}, null, 8, ["result"])) : v.value ? (a(), x(Q, { key: 2 }, [
|
|
95
|
+
e("div", ce, [
|
|
96
|
+
i(oe, {
|
|
97
|
+
source: ((_ = s(r)) == null ? void 0 : _.url) ?? o.source,
|
|
98
|
+
variant: "button",
|
|
99
|
+
watchMode: d.value,
|
|
100
|
+
onImportFinished: t[0] || (t[0] = () => o.$emit("importFinished"))
|
|
101
|
+
}, null, 8, ["source", "watchMode"])
|
|
102
|
+
]),
|
|
103
|
+
e("div", ae, [
|
|
104
|
+
e("div", de, [
|
|
105
|
+
t[2] || (t[2] = C(" Import to: ")),
|
|
106
|
+
i(re)
|
|
107
|
+
])
|
|
108
|
+
]),
|
|
109
|
+
(y = s(r)) != null && y.url ? (a(), x("div", me, [
|
|
110
|
+
e("div", ue, [
|
|
111
|
+
i(X, {
|
|
112
|
+
modelValue: d.value,
|
|
113
|
+
"onUpdate:modelValue": t[1] || (t[1] = (W) => d.value = W),
|
|
114
|
+
disableToolTip: !0
|
|
115
|
+
}, null, 8, ["modelValue"])
|
|
116
|
+
]),
|
|
117
|
+
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))
|
|
118
|
+
])) : f("", !0)
|
|
119
|
+
], 64)) : v.value ? f("", !0) : (a(), x("div", pe, [
|
|
120
|
+
e("div", fe, [
|
|
121
|
+
i(s(P), {
|
|
122
|
+
class: "text-red",
|
|
123
|
+
icon: "Error",
|
|
124
|
+
size: "sm"
|
|
125
|
+
}),
|
|
126
|
+
t[4] || (t[4] = e("div", null, " This doesn’t look like a valid OpenAPI/Swagger document. ", -1))
|
|
127
|
+
]),
|
|
128
|
+
e("div", xe, [
|
|
129
|
+
i(s(Z), {
|
|
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"])
|
|
133
|
+
])
|
|
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))
|
|
88
155
|
])
|
|
89
|
-
])
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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)
|
|
98
165
|
]),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
class: "hover:text-c-1",
|
|
102
|
-
href: "https://scalar.com/download",
|
|
103
|
-
target: "_blank"
|
|
104
|
-
}, " Download Scalar App "),
|
|
105
|
-
e("br"),
|
|
106
|
-
I(" Offline First - Open Source ")
|
|
107
|
-
], -1))
|
|
108
|
-
])
|
|
166
|
+
_: 1
|
|
167
|
+
}, 8, ["state"])
|
|
109
168
|
])
|
|
110
|
-
]
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
169
|
+
];
|
|
170
|
+
}),
|
|
171
|
+
_: 1
|
|
172
|
+
}, 8, ["state"]);
|
|
173
|
+
};
|
|
115
174
|
}
|
|
116
175
|
});
|
|
117
176
|
export {
|
|
118
|
-
|
|
177
|
+
De as default
|
|
119
178
|
};
|