@scalar/api-client 2.0.30 → 2.0.31
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 +8 -0
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts +2 -2
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +62 -47
- package/dist/components/CodeInput/codeDropdownWidget.d.ts +9 -1
- package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeDropdownWidget.js +62 -51
- package/dist/components/CodeInput/codeVariableWidget.d.ts +10 -1
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +63 -56
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +1 -1
- package/dist/components/TopNav/TopNav.vue2.js +65 -34
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/layouts/App/create-api-client-app.d.ts +2966 -0
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -0
- package/dist/layouts/App/create-api-client-app.js +18 -0
- package/dist/layouts/App/index.d.ts +1 -1
- package/dist/layouts/App/index.d.ts.map +1 -1
- package/dist/layouts/App/index.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts +1 -17
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +20 -24
- package/dist/layouts/Modal/api-client-modal.d.ts +5905 -57
- package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/api-client-modal.js +27 -129
- package/dist/libs/create-client.d.ts +3025 -0
- package/dist/libs/create-client.d.ts.map +1 -0
- package/dist/libs/create-client.js +147 -0
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +11 -9
- package/dist/router.d.ts +4 -20
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +28 -44
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -0
- package/dist/store/workspace.d.ts +3028 -603
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +454 -432
- package/dist/style.css +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +8 -0
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -31
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
- 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 +24 -23
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +26 -20
- package/package.json +10 -6
- package/dist/layouts/App/createApiClientApp.d.ts +0 -16
- package/dist/layouts/App/createApiClientApp.d.ts.map +0 -1
- package/dist/layouts/App/createApiClientApp.js +0 -62
- package/dist/store/topNav.d.ts +0 -445
- package/dist/store/topNav.d.ts.map +0 -1
- package/dist/store/topNav.js +0 -53
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { useRouter as j } from "vue-router";
|
|
6
|
-
const q = {
|
|
1
|
+
import { defineComponent as x, computed as b, openBlock as o, createElementBlock as s, Fragment as y, renderList as k, createElementVNode as a, normalizeClass as w, createTextVNode as c, toDisplayString as u, createBlock as E, unref as i, withCtx as C, createVNode as V } from "vue";
|
|
2
|
+
import { ScalarButton as B, ScalarIcon as z } from "@scalar/components";
|
|
3
|
+
import I from "fuse.js";
|
|
4
|
+
const N = {
|
|
7
5
|
id: "env-dialog",
|
|
8
6
|
class: "z-10 w-60 rounded border bg-b-1 p-1",
|
|
9
7
|
open: !0,
|
|
10
8
|
tabindex: "0"
|
|
11
|
-
},
|
|
9
|
+
}, P = { key: 0 }, S = ["onClick"], $ = { class: "flex items-center gap-1.5 whitespace-nowrap" }, j = { class: "w-20 overflow-hidden text-ellipsis text-right" }, L = /* @__PURE__ */ x({
|
|
12
10
|
__name: "EnvironmentVariableDropdown",
|
|
13
11
|
props: {
|
|
14
|
-
query: {}
|
|
12
|
+
query: {},
|
|
13
|
+
activeParsedEnvironments: {},
|
|
14
|
+
environments: {},
|
|
15
|
+
router: {}
|
|
15
16
|
},
|
|
16
17
|
emits: ["select"],
|
|
17
18
|
setup(d, { emit: p }) {
|
|
18
|
-
const
|
|
19
|
+
const n = d, v = p, { push: m } = n.router, f = new I(n.activeParsedEnvironments.value, {
|
|
19
20
|
keys: ["key", "value"]
|
|
20
|
-
}),
|
|
21
|
-
const e =
|
|
21
|
+
}), l = b(() => {
|
|
22
|
+
const e = n.query;
|
|
22
23
|
if (!e)
|
|
23
|
-
return
|
|
24
|
-
const r =
|
|
24
|
+
return n.activeParsedEnvironments.value.slice(-4);
|
|
25
|
+
const r = f.search(e);
|
|
25
26
|
return r.length > 0 ? r.map((t) => t.item) : [];
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
return (e, r) => (
|
|
30
|
-
|
|
31
|
-
(
|
|
32
|
-
key:
|
|
27
|
+
}), g = (e) => {
|
|
28
|
+
v("select", e);
|
|
29
|
+
}, h = (e) => "_scalarEnvId" in e ? `bg-${n.environments[e._scalarEnvId].color}` : "bg-grey";
|
|
30
|
+
return (e, r) => (o(), s("dialog", N, [
|
|
31
|
+
l.value.length ? (o(), s("ul", P, [
|
|
32
|
+
(o(!0), s(y, null, k(l.value, (t, _) => (o(), s("li", {
|
|
33
|
+
key: _,
|
|
33
34
|
class: "font-code text-3xs hover:bg-b-2 flex cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150",
|
|
34
|
-
onClick: (
|
|
35
|
+
onClick: (q) => g(t.key)
|
|
35
36
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class:
|
|
37
|
+
a("div", $, [
|
|
38
|
+
a("span", {
|
|
39
|
+
class: w(["h-2.5 w-2.5 min-w-2.5 rounded-full", h(t)])
|
|
39
40
|
}, null, 2),
|
|
40
41
|
c(" " + u(t.key), 1)
|
|
41
42
|
]),
|
|
42
|
-
|
|
43
|
-
], 8,
|
|
44
|
-
])) : (
|
|
43
|
+
a("span", j, u(t.value), 1)
|
|
44
|
+
], 8, S))), 128))
|
|
45
|
+
])) : (o(), E(i(B), {
|
|
45
46
|
key: 1,
|
|
46
47
|
class: "font-code text-3xs hover:bg-b-2 flex h-7 w-full justify-start gap-2 px-2 transition-colors duration-150",
|
|
47
48
|
variant: "secondary",
|
|
48
|
-
onClick: r[0] || (r[0] = (t) =>
|
|
49
|
+
onClick: r[0] || (r[0] = (t) => i(m)("/environment"))
|
|
49
50
|
}, {
|
|
50
|
-
default:
|
|
51
|
-
|
|
51
|
+
default: C(() => [
|
|
52
|
+
V(i(z), {
|
|
52
53
|
class: "w-2",
|
|
53
54
|
icon: "Add",
|
|
54
55
|
size: "xs"
|
|
@@ -61,5 +62,5 @@ const q = {
|
|
|
61
62
|
}
|
|
62
63
|
});
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
L as default
|
|
65
66
|
};
|
|
@@ -8,7 +8,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
8
8
|
isEnabledHidden: boolean;
|
|
9
9
|
showUploadButton: boolean;
|
|
10
10
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
-
updateRow: (idx: number, field: "
|
|
11
|
+
updateRow: (idx: number, field: "value" | "key", value: string) => void;
|
|
12
12
|
toggleRow: (idx: number, enabled: boolean) => void;
|
|
13
13
|
addRow: () => void;
|
|
14
14
|
deleteRow: () => void;
|
|
@@ -27,7 +27,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
27
27
|
}>>> & {
|
|
28
28
|
onInputFocus?: (() => any) | undefined;
|
|
29
29
|
onInputBlur?: (() => any) | undefined;
|
|
30
|
-
onUpdateRow?: ((idx: number, field: "
|
|
30
|
+
onUpdateRow?: ((idx: number, field: "value" | "key", value: string) => any) | undefined;
|
|
31
31
|
onToggleRow?: ((idx: number, enabled: boolean) => any) | undefined;
|
|
32
32
|
onAddRow?: (() => any) | undefined;
|
|
33
33
|
onDeleteRow?: (() => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"AA2PA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;AA0HlD,iBAAS,cAAc;gBAvFT,IAAI;;gBAAJ,IAAI;EAmXjB;AACD,QAAA,MAAM,eAAe;IA9YjB;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,OAAO;IACrB,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;IAdpD;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,OAAO;IACrB,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;iBATtC,OAAO;iBAMP,OAAO;MA0YvB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import t from "./RequestSidebarItem.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
5
|
+
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f2df081d"]]);
|
|
6
6
|
export {
|
|
7
7
|
p as default
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as j, useCssVars as F, computed as o, resolveComponent as L, openBlock as a, createElementBlock as d, normalizeClass as u, unref as i, createVNode as m, withCtx as D, createBlock as p, createElementVNode as n, toDisplayString as y, createCommentVNode as f, createTextVNode as k, renderSlot as P, withDirectives as T, Fragment as W, renderList as A, vShow as _ } from "vue";
|
|
2
|
+
import { PathId as G } from "../../router.js";
|
|
3
3
|
import { useWorkspace as H } from "../../store/workspace.js";
|
|
4
4
|
import { ScalarIcon as J } from "@scalar/components";
|
|
5
5
|
import { Draggable as K } from "@scalar/draggable";
|
|
@@ -7,7 +7,7 @@ import { RouterLink as M } from "vue-router";
|
|
|
7
7
|
import Q from "./RequestSidebarItemMenu.vue.js";
|
|
8
8
|
import X from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
9
9
|
import { useSidebar as Y } from "../../hooks/useSidebar.js";
|
|
10
|
-
const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" }, ee = { class: "relative" }, te = { class: "flex" }, ie = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, se = { class: "z-10 font-medium" }, re = { key: 2 }, q = "hover:bg-sidebar-active-b indent-padding-left", be = /* @__PURE__ */
|
|
10
|
+
const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" }, ee = { class: "relative" }, te = { class: "flex" }, ie = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, se = { class: "z-10 font-medium" }, re = { key: 2 }, q = "hover:bg-sidebar-active-b indent-padding-left", be = /* @__PURE__ */ j({
|
|
11
11
|
__name: "RequestSidebarItem",
|
|
12
12
|
props: {
|
|
13
13
|
isDraggable: { type: Boolean, default: !1 },
|
|
@@ -17,30 +17,31 @@ const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" },
|
|
|
17
17
|
},
|
|
18
18
|
emits: ["onDragEnd"],
|
|
19
19
|
setup($) {
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
20
|
+
F((e) => ({
|
|
21
|
+
"1fe07419": R.value,
|
|
22
|
+
"096d41f6": E.value
|
|
23
23
|
}));
|
|
24
24
|
const t = $, {
|
|
25
25
|
activeRequest: b,
|
|
26
|
+
activeRouterParams: w,
|
|
26
27
|
activeWorkspace: c,
|
|
27
|
-
folders:
|
|
28
|
+
folders: x,
|
|
28
29
|
isReadOnly: l,
|
|
29
30
|
requests: g,
|
|
30
|
-
requestExamples:
|
|
31
|
-
} = H(), { collapsedSidebarFolders: h, toggleSidebarFolder:
|
|
31
|
+
requestExamples: C
|
|
32
|
+
} = H(), { collapsedSidebarFolders: h, toggleSidebarFolder: S } = Y(), v = o(() => "childUids" in t.item), R = o(() => t.parentUids.length ? l.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), E = o(() => t.parentUids.length ? l.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), U = (e) => {
|
|
32
33
|
var s;
|
|
33
34
|
return "spec" in e ? (s = e.spec.info) == null ? void 0 : s.title : "summary" in e ? e.summary || e.path : "name" in e ? e.name : "";
|
|
34
|
-
},
|
|
35
|
+
}, I = o(() => ("requestUid" in t.item ? g[t.item.requestUid] : t.item).method), z = o(
|
|
35
36
|
() => {
|
|
36
37
|
var e;
|
|
37
38
|
return h[t.item.uid] || ((e = b.value) == null ? void 0 : e.uid) === t.item.uid && t.item.childUids.length > 1;
|
|
38
39
|
}
|
|
39
|
-
),
|
|
40
|
-
() =>
|
|
40
|
+
), B = () => "requestUid" in t.item ? `/workspace/${c.value.uid}/request/${t.item.requestUid}/examples/${t.item.uid}` : `/workspace/${c.value.uid}/request/${t.item.uid}`, O = o(
|
|
41
|
+
() => w.value[G.Request] === "default" && b.value.uid === t.item.uid
|
|
41
42
|
);
|
|
42
43
|
return (e, s) => {
|
|
43
|
-
const
|
|
44
|
+
const V = L("RequestSidebarItem", !0);
|
|
44
45
|
return a(), d("div", {
|
|
45
46
|
class: u(["relative flex flex-row", [
|
|
46
47
|
i(l) && e.parentUids.length > 1 || !i(l) && e.parentUids.length ? "before:bg-b-3 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:z-10 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-px mb-[.5px] last:mb-0 indent-border-line-offset" : ""
|
|
@@ -60,13 +61,13 @@ const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" },
|
|
|
60
61
|
"summary" in e.item || "requestUid" in e.item ? (a(), p(i(M), {
|
|
61
62
|
key: 0,
|
|
62
63
|
class: "no-underline",
|
|
63
|
-
to:
|
|
64
|
+
to: B()
|
|
64
65
|
}, {
|
|
65
66
|
default: D(({ isExactActive: r }) => [
|
|
66
67
|
n("div", {
|
|
67
68
|
class: u(["group relative flex min-h-8 cursor-pointer flex-row items-start justify-between gap-2 py-1.5 pr-2 rounded editable-sidebar-hover", [
|
|
68
69
|
q,
|
|
69
|
-
r ||
|
|
70
|
+
r || O.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
|
|
70
71
|
]]),
|
|
71
72
|
tabindex: "0"
|
|
72
73
|
}, [
|
|
@@ -80,7 +81,7 @@ const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" },
|
|
|
80
81
|
k(" "),
|
|
81
82
|
m(i(X), {
|
|
82
83
|
class: "font-bold",
|
|
83
|
-
method:
|
|
84
|
+
method: I.value
|
|
84
85
|
}, null, 8, ["method"])
|
|
85
86
|
])
|
|
86
87
|
])
|
|
@@ -91,10 +92,10 @@ const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" },
|
|
|
91
92
|
key: 1,
|
|
92
93
|
class: u(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", q]),
|
|
93
94
|
type: "button",
|
|
94
|
-
onClick: s[0] || (s[0] = (r) => i(
|
|
95
|
+
onClick: s[0] || (s[0] = (r) => i(S)(e.item.uid))
|
|
95
96
|
}, [
|
|
96
97
|
n("span", ie, [
|
|
97
|
-
|
|
98
|
+
P(e.$slots, "leftIcon", {}, () => [
|
|
98
99
|
n("div", {
|
|
99
100
|
class: u({
|
|
100
101
|
"rotate-90": i(h)[e.item.uid]
|
|
@@ -112,17 +113,17 @@ const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" },
|
|
|
112
113
|
]),
|
|
113
114
|
n("span", se, y(U(e.item)), 1)
|
|
114
115
|
])) : f("", !0),
|
|
115
|
-
"childUids" in e.item ?
|
|
116
|
-
(a(!0), d(
|
|
116
|
+
"childUids" in e.item ? T((a(), d("div", re, [
|
|
117
|
+
(a(!0), d(W, null, A("summary" in e.item ? e.item.childUids.slice(1) : e.item.childUids, (r) => (a(), p(V, {
|
|
117
118
|
key: r,
|
|
118
119
|
isDraggable: e.isDraggable,
|
|
119
120
|
isDroppable: e.isDroppable,
|
|
120
|
-
item: i(
|
|
121
|
+
item: i(x)[r] || i(g)[r] || i(C)[r],
|
|
121
122
|
parentUids: [...e.parentUids, e.item.uid],
|
|
122
|
-
onOnDragEnd: s[1] || (s[1] = (...
|
|
123
|
+
onOnDragEnd: s[1] || (s[1] = (...N) => e.$emit("onDragEnd", ...N))
|
|
123
124
|
}, null, 8, ["isDraggable", "isDroppable", "item", "parentUids"]))), 128))
|
|
124
125
|
], 512)), [
|
|
125
|
-
[
|
|
126
|
+
[_, z.value]
|
|
126
127
|
]) : f("", !0)
|
|
127
128
|
]),
|
|
128
129
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA8IA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;UAO1C,OAAO,GAAG,cAAc;;UAAxB,OAAO,GAAG,cAAc;;AA2VhC,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { commandPaletteBus as
|
|
3
|
-
import {
|
|
4
|
-
import { useWorkspace as
|
|
1
|
+
import { defineComponent as E, computed as R, openBlock as u, createBlock as d, unref as e, withCtx as l, createVNode as t, createCommentVNode as z, createElementVNode as n } from "vue";
|
|
2
|
+
import { commandPaletteBus as C } from "../../libs/eventBusses/command-palette.js";
|
|
3
|
+
import { PathId as p } from "../../router.js";
|
|
4
|
+
import { useWorkspace as I } from "../../store/workspace.js";
|
|
5
5
|
import { ScalarDropdown as w, ScalarDropdownItem as o, ScalarIcon as s, ScalarDropdownDivider as S, ScalarButton as b } from "@scalar/components";
|
|
6
6
|
import { useRouter as A } from "vue-router";
|
|
7
|
-
const B = /* @__PURE__ */ n("span", null, "Add Example", -1), N = /* @__PURE__ */ n("span", null, "Rename", -1), M = /* @__PURE__ */ n("span", null, "Duplicate", -1), P = /* @__PURE__ */ n("span", null, "Delete", -1), j = /* @__PURE__ */
|
|
7
|
+
const B = /* @__PURE__ */ n("span", null, "Add Example", -1), N = /* @__PURE__ */ n("span", null, "Rename", -1), M = /* @__PURE__ */ n("span", null, "Duplicate", -1), P = /* @__PURE__ */ n("span", null, "Delete", -1), j = /* @__PURE__ */ E({
|
|
8
8
|
__name: "RequestSidebarItemMenu",
|
|
9
9
|
props: {
|
|
10
10
|
item: {}
|
|
11
11
|
},
|
|
12
12
|
setup(f) {
|
|
13
|
-
const a = f, {
|
|
13
|
+
const a = f, {
|
|
14
|
+
activeWorkspace: c,
|
|
15
|
+
activeRouterParams: r,
|
|
16
|
+
findRequestFolders: _,
|
|
17
|
+
requestMutators: x,
|
|
18
|
+
requestExampleMutators: h
|
|
19
|
+
} = I(), { replace: m } = A(), k = () => C.emit({
|
|
14
20
|
commandName: "Add Example",
|
|
15
21
|
metaData: a.item.uid
|
|
16
|
-
}),
|
|
22
|
+
}), v = () => {
|
|
17
23
|
console.log("rename");
|
|
18
|
-
}, v = () => {
|
|
19
|
-
console.log("duplicate");
|
|
20
24
|
}, g = () => {
|
|
25
|
+
console.log("duplicate");
|
|
26
|
+
}, D = () => {
|
|
21
27
|
if ("requestUid" in a.item)
|
|
22
|
-
|
|
28
|
+
h.delete(a.item), r.value[p.Examples] === a.item.uid && m(`/workspace/${c.value}/request/default`);
|
|
23
29
|
else {
|
|
24
|
-
const i =
|
|
30
|
+
const i = _(a.item.uid);
|
|
25
31
|
if (!i.length) return;
|
|
26
|
-
|
|
32
|
+
x.delete(a.item, i[0]), r.value[p.Request] === a.item.uid && m(`/workspace/${c.value.uid}/request/default`);
|
|
27
33
|
}
|
|
28
|
-
},
|
|
29
|
-
return (i, V) => (
|
|
34
|
+
}, q = R(() => "summary" in a.item);
|
|
35
|
+
return (i, V) => (u(), d(e(w), { teleport: "#scalar-client" }, {
|
|
30
36
|
items: l(() => [
|
|
31
|
-
|
|
37
|
+
q.value ? (u(), d(e(o), {
|
|
32
38
|
key: 0,
|
|
33
39
|
class: "flex !gap-2",
|
|
34
|
-
onClick:
|
|
40
|
+
onClick: k
|
|
35
41
|
}, {
|
|
36
42
|
default: l(() => [
|
|
37
43
|
t(e(s), {
|
|
@@ -42,10 +48,10 @@ const B = /* @__PURE__ */ n("span", null, "Add Example", -1), N = /* @__PURE__ *
|
|
|
42
48
|
B
|
|
43
49
|
]),
|
|
44
50
|
_: 1
|
|
45
|
-
})) :
|
|
51
|
+
})) : z("", !0),
|
|
46
52
|
t(e(o), {
|
|
47
53
|
class: "flex !gap-2",
|
|
48
|
-
onClick:
|
|
54
|
+
onClick: v
|
|
49
55
|
}, {
|
|
50
56
|
default: l(() => [
|
|
51
57
|
t(e(s), {
|
|
@@ -59,7 +65,7 @@ const B = /* @__PURE__ */ n("span", null, "Add Example", -1), N = /* @__PURE__ *
|
|
|
59
65
|
}),
|
|
60
66
|
t(e(o), {
|
|
61
67
|
class: "flex !gap-2",
|
|
62
|
-
onClick:
|
|
68
|
+
onClick: g
|
|
63
69
|
}, {
|
|
64
70
|
default: l(() => [
|
|
65
71
|
t(e(s), {
|
|
@@ -74,7 +80,7 @@ const B = /* @__PURE__ */ n("span", null, "Add Example", -1), N = /* @__PURE__ *
|
|
|
74
80
|
t(e(S)),
|
|
75
81
|
t(e(o), {
|
|
76
82
|
class: "flex !gap-2",
|
|
77
|
-
onClick:
|
|
83
|
+
onClick: D
|
|
78
84
|
}, {
|
|
79
85
|
default: l(() => [
|
|
80
86
|
t(e(s), {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.0.
|
|
21
|
+
"version": "2.0.31",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"import": "./dist/views/Request/components/index.js",
|
|
38
38
|
"types": "./dist/views/Request/components/index.d.ts"
|
|
39
39
|
},
|
|
40
|
+
"./store": {
|
|
41
|
+
"import": "./dist/store/index.js",
|
|
42
|
+
"types": "./dist/store/index.d.ts"
|
|
43
|
+
},
|
|
40
44
|
"./libs": {
|
|
41
45
|
"import": "./dist/libs/index.js",
|
|
42
46
|
"types": "./dist/libs/index.d.ts"
|
|
@@ -118,14 +122,14 @@
|
|
|
118
122
|
"vue": "^3.4.29",
|
|
119
123
|
"vue-router": "^4.3.0",
|
|
120
124
|
"zod": "^3.22.4",
|
|
125
|
+
"@scalar/components": "0.12.19",
|
|
121
126
|
"@scalar/oas-utils": "0.2.17",
|
|
122
|
-
"@scalar/object-utils": "1.1.
|
|
123
|
-
"@scalar/
|
|
124
|
-
"@scalar/use-codemirror": "0.11.8",
|
|
127
|
+
"@scalar/object-utils": "1.1.5",
|
|
128
|
+
"@scalar/themes": "0.9.16",
|
|
125
129
|
"@scalar/use-toasts": "0.7.4",
|
|
130
|
+
"@scalar/use-codemirror": "0.11.8",
|
|
126
131
|
"@scalar/use-tooltip": "1.0.2",
|
|
127
|
-
"@scalar/
|
|
128
|
-
"@scalar/components": "0.12.19"
|
|
132
|
+
"@scalar/draggable": "0.1.3"
|
|
129
133
|
},
|
|
130
134
|
"devDependencies": {
|
|
131
135
|
"@types/content-type": "^1.1.8",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ClientConfiguration } from '../../layouts/Modal/index.js';
|
|
2
|
-
import type { SpecConfiguration } from '@scalar/oas-utils';
|
|
3
|
-
/**
|
|
4
|
-
* Mount the full-blown API Client modal to a given element.
|
|
5
|
-
*/
|
|
6
|
-
export declare const createApiClientApp: (el: HTMLElement | null, config: ClientConfiguration, mountOnInitialize?: boolean) => Promise<{
|
|
7
|
-
/** The vue app instance for the modal, be careful with this */
|
|
8
|
-
app: import("vue").App<Element>;
|
|
9
|
-
/** Update the API client config */
|
|
10
|
-
updateConfig(newConfig: ClientConfiguration, mergeConfigs?: boolean): void;
|
|
11
|
-
/** Update the spec file, this will re-parse it and clear your store */
|
|
12
|
-
updateSpec: (spec: SpecConfiguration) => void;
|
|
13
|
-
/** Mount the references to a given element */
|
|
14
|
-
mount: (mountingEl?: HTMLElement | null) => void;
|
|
15
|
-
}>;
|
|
16
|
-
//# sourceMappingURL=createApiClientApp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createApiClientApp.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/createApiClientApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAG1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAM1D;;GAEG;AACH,eAAO,MAAM,kBAAkB,OAEzB,WAAW,GAAG,IAAI,UAEd,mBAAmB;IAiEzB,+DAA+D;;IAE/D,mCAAmC;4BACX,mBAAmB;IAQ3C,uEAAuE;uBACpD,iBAAiB;IAapC,8CAA8C;;EAGjD,CAAA"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { router as A } from "../../router.js";
|
|
2
|
-
import { useWorkspace as h } from "../../store/workspace.js";
|
|
3
|
-
import { objectMerge as I } from "@scalar/oas-utils/helpers";
|
|
4
|
-
import { createApp as v } from "vue";
|
|
5
|
-
import P from "./ApiClientApp.vue.js";
|
|
6
|
-
/* empty css */
|
|
7
|
-
const f = async (s, t, n = !0) => {
|
|
8
|
-
var c, m, u;
|
|
9
|
-
const {
|
|
10
|
-
activeWorkspace: r,
|
|
11
|
-
importSpecFile: a,
|
|
12
|
-
importSpecFromUrl: l,
|
|
13
|
-
workspaceMutators: p
|
|
14
|
-
} = h();
|
|
15
|
-
(c = t.spec) != null && c.url ? await l(t.spec.url, t.proxyUrl) : (m = t.spec) != null && m.content ? await a((u = t.spec) == null ? void 0 : u.content) : console.error(
|
|
16
|
-
"[createApiClientApp] Could not create the API client.",
|
|
17
|
-
"Please provide an OpenAPI document: { spec: { url: '…' } }",
|
|
18
|
-
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client"
|
|
19
|
-
);
|
|
20
|
-
const o = v(P);
|
|
21
|
-
o.use(A);
|
|
22
|
-
const i = (e = s) => {
|
|
23
|
-
if (!e) {
|
|
24
|
-
console.error(
|
|
25
|
-
"[createApiClientApp] Could not create the API client.",
|
|
26
|
-
"Invalid HTML element provided.",
|
|
27
|
-
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client"
|
|
28
|
-
);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
o.mount(e);
|
|
32
|
-
};
|
|
33
|
-
return r.value && (n && i(), t.proxyUrl && p.edit(
|
|
34
|
-
r.value.uid,
|
|
35
|
-
"proxyUrl",
|
|
36
|
-
t.proxyUrl
|
|
37
|
-
), t.themeId && p.edit(
|
|
38
|
-
r.value.uid,
|
|
39
|
-
"themeId",
|
|
40
|
-
t.themeId
|
|
41
|
-
)), {
|
|
42
|
-
/** The vue app instance for the modal, be careful with this */
|
|
43
|
-
app: o,
|
|
44
|
-
/** Update the API client config */
|
|
45
|
-
updateConfig(e, d = !0) {
|
|
46
|
-
d ? Object.assign(t, e) : I(t, e), e.spec && a(e.spec);
|
|
47
|
-
},
|
|
48
|
-
/** Update the spec file, this will re-parse it and clear your store */
|
|
49
|
-
updateSpec: (e) => {
|
|
50
|
-
e != null && e.url ? l(e.url, t.proxyUrl) : e != null && e.content ? a(e == null ? void 0 : e.content) : console.error(
|
|
51
|
-
"[createApiClientApp] Could not create the API client.",
|
|
52
|
-
"Please provide an OpenAPI document: { spec: { url: '…' } }",
|
|
53
|
-
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client"
|
|
54
|
-
);
|
|
55
|
-
},
|
|
56
|
-
/** Mount the references to a given element */
|
|
57
|
-
mount: i
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
f as createApiClientApp
|
|
62
|
-
};
|