@scalar/api-client 2.1.35 → 2.1.37
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 +21 -0
- 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/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/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
- 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/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/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +7 -7
- 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/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- 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 +7 -7
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
|
@@ -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
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
source?: string | null;
|
|
3
3
|
variant?: "button" | "link";
|
|
4
|
+
watchMode?: boolean;
|
|
4
5
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
6
|
importFinished: () => any;
|
|
6
7
|
}, string, import("vue").PublicProps, Readonly<{
|
|
7
8
|
source?: string | null;
|
|
8
9
|
variant?: "button" | "link";
|
|
10
|
+
watchMode?: boolean;
|
|
9
11
|
}> & Readonly<{
|
|
10
12
|
onImportFinished?: (() => any) | undefined;
|
|
11
13
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";aA+GW,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;gBACf,OAAO;;;;aAFV,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;gBACf,OAAO;;;;AAkLrB,wBASG"}
|
|
@@ -1,72 +1,76 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isUrl as
|
|
1
|
+
import { defineComponent as C, openBlock as s, createElementBlock as v, Fragment as b, createBlock as u, unref as m, withCtx as p, createTextVNode as c, createCommentVNode as g } from "vue";
|
|
2
|
+
import { isUrl as x } from "./utils/isUrl.js";
|
|
3
3
|
import { ScalarButton as l } from "@scalar/components";
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import { useRouter as
|
|
4
|
+
import { useToasts as B } from "@scalar/use-toasts";
|
|
5
|
+
import { useRouter as F } from "vue-router";
|
|
6
6
|
import { useWorkspace as I } from "../../store/store.js";
|
|
7
|
-
const
|
|
7
|
+
const z = /* @__PURE__ */ C({
|
|
8
8
|
__name: "ImportNowButton",
|
|
9
9
|
props: {
|
|
10
10
|
source: {},
|
|
11
|
-
variant: {}
|
|
11
|
+
variant: {},
|
|
12
|
+
watchMode: { type: Boolean }
|
|
12
13
|
},
|
|
13
14
|
emits: ["importFinished"],
|
|
14
15
|
setup(f, { emit: d }) {
|
|
15
|
-
const o = f, k = d,
|
|
16
|
-
async function
|
|
16
|
+
const o = f, k = d, w = F(), { importSpecFromUrl: y, importSpecFile: h, activeWorkspace: r } = I(), { toast: n } = B();
|
|
17
|
+
async function i() {
|
|
17
18
|
try {
|
|
18
19
|
if (o.source) {
|
|
19
|
-
if (
|
|
20
|
-
const [
|
|
20
|
+
if (x(o.source)) {
|
|
21
|
+
const [e, t] = await y(
|
|
21
22
|
o.source,
|
|
22
|
-
r.value.uid
|
|
23
|
+
r.value.uid,
|
|
24
|
+
{
|
|
25
|
+
watchMode: o.watchMode
|
|
26
|
+
}
|
|
23
27
|
);
|
|
24
|
-
|
|
28
|
+
e || a(t);
|
|
25
29
|
} else {
|
|
26
|
-
const
|
|
30
|
+
const e = await h(
|
|
27
31
|
o.source,
|
|
28
32
|
r.value.uid
|
|
29
33
|
);
|
|
30
|
-
|
|
34
|
+
a(e);
|
|
31
35
|
}
|
|
32
|
-
|
|
36
|
+
n("Import successful", "info"), k("importFinished");
|
|
33
37
|
}
|
|
34
|
-
} catch (
|
|
35
|
-
console.error("[importCollection]",
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
+
} catch (e) {
|
|
39
|
+
console.error("[importCollection]", e);
|
|
40
|
+
const t = (e == null ? void 0 : e.message) || "Unknown error";
|
|
41
|
+
n(`Import failed: ${t}`, "error");
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
44
|
+
function a(e) {
|
|
45
|
+
e && w.push({
|
|
42
46
|
name: "request",
|
|
43
47
|
params: {
|
|
44
48
|
workspace: r.value.uid,
|
|
45
|
-
request:
|
|
49
|
+
request: e == null ? void 0 : e.requests[0]
|
|
46
50
|
}
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
|
-
return (
|
|
50
|
-
|
|
53
|
+
return (e, t) => e.source ? (s(), v(b, { key: 0 }, [
|
|
54
|
+
e.variant === "button" ? (s(), u(m(l), {
|
|
51
55
|
key: 0,
|
|
52
|
-
class: "
|
|
56
|
+
class: "py-2.5 px-6 rounded-lg font-bold h-fit mt-3 w-full",
|
|
53
57
|
size: "md",
|
|
54
58
|
type: "button",
|
|
55
|
-
onClick:
|
|
59
|
+
onClick: i
|
|
56
60
|
}, {
|
|
57
|
-
default: p(() =>
|
|
61
|
+
default: p(() => t[0] || (t[0] = [
|
|
58
62
|
c(" Import Collection ")
|
|
59
63
|
])),
|
|
60
64
|
_: 1
|
|
61
|
-
})) : (s(), m(
|
|
65
|
+
})) : (s(), u(m(l), {
|
|
62
66
|
key: 1,
|
|
63
67
|
class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit",
|
|
64
68
|
size: "md",
|
|
65
69
|
type: "button",
|
|
66
70
|
variant: "ghost",
|
|
67
|
-
onClick:
|
|
71
|
+
onClick: i
|
|
68
72
|
}, {
|
|
69
|
-
default: p(() =>
|
|
73
|
+
default: p(() => t[1] || (t[1] = [
|
|
70
74
|
c(" Try it in the browser ")
|
|
71
75
|
])),
|
|
72
76
|
_: 1
|
|
@@ -75,5 +79,5 @@ const R = /* @__PURE__ */ b({
|
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
export {
|
|
78
|
-
|
|
82
|
+
z as default
|
|
79
83
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
integration: string | null;
|
|
3
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
4
|
+
integration: string | null;
|
|
5
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=IntegrationLogo.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntegrationLogo.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/IntegrationLogo.vue"],"names":[],"mappings":";iBAkEe,MAAM,GAAG,IAAI;;iBAAb,MAAM,GAAG,IAAI;;AAqG5B,wBAMG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent as i, computed as l, openBlock as p, createElementBlock as d, createElementVNode as u, createVNode as f, unref as m } from "vue";
|
|
2
|
+
import { ScalarIcon as g } from "@scalar/components";
|
|
3
|
+
const _ = { class: "flex justify-center items-center mb-2 p-1" }, x = { class: "rounded-xl" }, j = /* @__PURE__ */ i({
|
|
4
|
+
__name: "IntegrationLogo",
|
|
5
|
+
props: {
|
|
6
|
+
integration: {}
|
|
7
|
+
},
|
|
8
|
+
setup(n) {
|
|
9
|
+
const s = n, a = [
|
|
10
|
+
"adonisjs",
|
|
11
|
+
"dotnet",
|
|
12
|
+
"elysiajs",
|
|
13
|
+
"express",
|
|
14
|
+
"fastapi",
|
|
15
|
+
"fastify",
|
|
16
|
+
"go",
|
|
17
|
+
"hono",
|
|
18
|
+
"laravel",
|
|
19
|
+
"litestar",
|
|
20
|
+
"nestjs",
|
|
21
|
+
"nextjs",
|
|
22
|
+
"nitro",
|
|
23
|
+
"nuxt",
|
|
24
|
+
"platformatic",
|
|
25
|
+
"react",
|
|
26
|
+
"rust"
|
|
27
|
+
], r = l(() => {
|
|
28
|
+
var o;
|
|
29
|
+
const t = "Openapi", e = (o = s.integration) == null ? void 0 : o.toLocaleLowerCase();
|
|
30
|
+
if (!e) return t;
|
|
31
|
+
const c = e.charAt(0).toUpperCase() + e.slice(1);
|
|
32
|
+
return a.includes(e) ? c : t;
|
|
33
|
+
});
|
|
34
|
+
return (t, e) => (p(), d("div", _, [
|
|
35
|
+
u("div", x, [
|
|
36
|
+
f(m(g), {
|
|
37
|
+
class: "size-10 rounded-lg",
|
|
38
|
+
logo: r.value
|
|
39
|
+
}, null, 8, ["logo"])
|
|
40
|
+
])
|
|
41
|
+
]));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
j as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PrefetchResult } from '../../components/ImportCollection/hooks/useUrlPrefetcher.js';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
prefetchResult: PrefetchResult;
|
|
4
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
5
|
+
prefetchResult: PrefetchResult;
|
|
6
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=PrefetchError.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrefetchError.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/PrefetchError.vue"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAA;;oBAOxE,cAAc;;oBAAd,cAAc;;AA2GhC,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
-
input: (
|
|
2
|
+
input: (url: string, integration: string | null) => any;
|
|
3
3
|
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
-
onInput?: ((
|
|
4
|
+
onInput?: ((url: string, integration: string | null) => any) | undefined;
|
|
5
5
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
6
|
export default _default;
|
|
7
7
|
//# sourceMappingURL=UrlQueryParameterChecker.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlQueryParameterChecker.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/UrlQueryParameterChecker.vue"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"UrlQueryParameterChecker.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/UrlQueryParameterChecker.vue"],"names":[],"mappings":";;;;;AAiFA,wBAQG"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as a, onMounted as o } from "vue";
|
|
2
|
-
const
|
|
2
|
+
const c = /* @__PURE__ */ a({
|
|
3
3
|
__name: "UrlQueryParameterChecker",
|
|
4
4
|
emits: ["input"],
|
|
5
|
-
setup(
|
|
6
|
-
const
|
|
5
|
+
setup(i, { emit: r }) {
|
|
6
|
+
const n = r;
|
|
7
7
|
return o(() => {
|
|
8
|
-
const e = new URLSearchParams(window.location.search).get("url");
|
|
9
|
-
|
|
10
|
-
}), (
|
|
8
|
+
const e = new URLSearchParams(window.location.search), t = e.get("url");
|
|
9
|
+
t && n("input", t, e.get("integration"));
|
|
10
|
+
}), (e, t) => null;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
c as default
|
|
15
15
|
};
|
|
@@ -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":";AAkeA,wBAKG"}
|