@scalar/api-client 2.19.3 → 2.20.1
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 +54 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +0 -9
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +126 -67
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +6 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +25 -24
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +44 -41
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts +42 -0
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +31 -0
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts +66 -0
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js +43 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +40 -38
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +34 -33
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +3 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +28 -28
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +31 -22
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +6 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +24 -23
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +2 -3
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +20 -20
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js +2 -2
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +60 -54
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +53 -42
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +72 -72
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +84 -76
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +82 -43
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +2 -3
- package/dist/v2/features/operation/helpers/combine-params.d.ts +2 -2
- package/dist/v2/features/operation/helpers/combine-params.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/combine-params.js +11 -10
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +12 -6
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-e30bf25b"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, mergeModels as
|
|
1
|
+
import { defineComponent as q, mergeModels as C, computed as f, capitalize as V, useModel as W, ref as G, createElementBlock as g, openBlock as u, createVNode as l, createBlock as B, createCommentVNode as c, unref as i, createSlots as R, withCtx as r, createTextVNode as y, createElementVNode as d, withKeys as k, withModifiers as p, toDisplayString as j, renderSlot as F, normalizeClass as H, nextTick as L } from "vue";
|
|
2
2
|
import { useModal as U, ScalarSidebarItem as I, ScalarIconButton as J, ScalarButton as $, ScalarModal as Y } from "@scalar/components";
|
|
3
3
|
import { ScalarIconPlus as Q, ScalarIconDotsThree as X, ScalarIconGlobe as Z } from "@scalar/icons";
|
|
4
4
|
import { getParentEntry as w } from "@scalar/workspace-store/navigation";
|
|
@@ -10,11 +10,14 @@ import ae from "./SidebarItemMenu.vue.js";
|
|
|
10
10
|
import { dragHandleFactory as oe } from "../../../helpers/drag-handle-factory.js";
|
|
11
11
|
import ne from "../../../components/sidebar/Sidebar.vue.js";
|
|
12
12
|
const ie = { class: "flex" }, se = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "flex items-center"
|
|
15
|
+
}, re = {
|
|
13
16
|
key: 0,
|
|
14
17
|
class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
|
|
15
|
-
},
|
|
18
|
+
}, le = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, de = { class: "gap-1.5 p-2" }, ge = /* @__PURE__ */ q({
|
|
16
19
|
__name: "AppSidebar",
|
|
17
|
-
props: /* @__PURE__ */
|
|
20
|
+
props: /* @__PURE__ */ C({
|
|
18
21
|
layout: {},
|
|
19
22
|
sidebarState: {},
|
|
20
23
|
isWorkspaceOpen: { type: Boolean },
|
|
@@ -31,65 +34,65 @@ const ie = { class: "flex" }, se = {
|
|
|
31
34
|
},
|
|
32
35
|
sidebarWidthModifiers: {}
|
|
33
36
|
}),
|
|
34
|
-
emits: /* @__PURE__ */
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
37
|
+
emits: /* @__PURE__ */ C(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
|
|
38
|
+
setup(a, { emit: O }) {
|
|
39
|
+
const v = O, A = f(() => V(a.activeWorkspace.label)), M = W(a, "isSidebarOpen"), h = W(a, "sidebarWidth"), S = f(() => a.sidebarState.items.value.length <= 1), x = f(
|
|
37
40
|
() => oe({
|
|
38
|
-
store:
|
|
39
|
-
sidebarState:
|
|
41
|
+
store: a.store,
|
|
42
|
+
sidebarState: a.sidebarState
|
|
40
43
|
})
|
|
41
|
-
), D = (
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
+
), D = (o, e) => x.value.handleDragEnd(o, e), N = (o, e) => x.value.isDroppable(o, e), s = G(null), b = U(), T = f(() => {
|
|
45
|
+
const o = s.value?.item;
|
|
46
|
+
return o?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${o?.type ?? "item"}? This action cannot be undone.`;
|
|
44
47
|
}), z = () => {
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
48
|
+
const o = s.value?.item;
|
|
49
|
+
if (!o)
|
|
47
50
|
return;
|
|
48
|
-
const e =
|
|
51
|
+
const e = a.sidebarState.getEntryById(o.id), t = w("document", e), n = w("operation", e);
|
|
49
52
|
if (t) {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
else if (
|
|
53
|
-
|
|
53
|
+
if (o.type === "document")
|
|
54
|
+
a.eventBus.emit("document:delete:document", { name: t.name });
|
|
55
|
+
else if (o.type === "tag")
|
|
56
|
+
a.eventBus.emit("tag:delete:tag", {
|
|
54
57
|
documentName: t.name,
|
|
55
|
-
name:
|
|
58
|
+
name: o.name
|
|
56
59
|
});
|
|
57
|
-
else if (
|
|
60
|
+
else if (o.type === "operation") {
|
|
58
61
|
if (!n)
|
|
59
62
|
return;
|
|
60
|
-
|
|
63
|
+
a.eventBus.emit("operation:delete:operation", {
|
|
61
64
|
meta: {
|
|
62
65
|
method: n.method,
|
|
63
66
|
path: n.path
|
|
64
67
|
},
|
|
65
68
|
documentName: t.name
|
|
66
69
|
});
|
|
67
|
-
} else if (
|
|
70
|
+
} else if (o.type === "example") {
|
|
68
71
|
if (!n)
|
|
69
72
|
return;
|
|
70
|
-
|
|
73
|
+
a.eventBus.emit("operation:delete:example", {
|
|
71
74
|
meta: {
|
|
72
75
|
method: n.method,
|
|
73
76
|
path: n.path,
|
|
74
|
-
exampleKey:
|
|
77
|
+
exampleKey: o.name
|
|
75
78
|
},
|
|
76
79
|
documentName: t.name
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
|
-
|
|
82
|
+
b.hide(), s.value = null;
|
|
80
83
|
}
|
|
81
|
-
},
|
|
84
|
+
}, m = async (o, e) => {
|
|
82
85
|
if (s.value?.showMenu)
|
|
83
86
|
return;
|
|
84
|
-
const t =
|
|
87
|
+
const t = o.currentTarget;
|
|
85
88
|
s.value = { item: e, el: t, showMenu: !0 }, await L();
|
|
86
|
-
const n =
|
|
89
|
+
const n = o instanceof MouseEvent ? new MouseEvent(o.type, o) : new KeyboardEvent(o.type, o);
|
|
87
90
|
s.value?.el.dispatchEvent(n);
|
|
88
91
|
}, K = () => {
|
|
89
92
|
s.value && (s.value.showMenu = !1);
|
|
90
|
-
}, P = (
|
|
91
|
-
const e =
|
|
92
|
-
|
|
93
|
+
}, P = (o) => {
|
|
94
|
+
const e = a.sidebarState.getEntryById(o.id), t = w("document", e), n = w("tag", e);
|
|
95
|
+
a.eventBus.emit("ui:open:command-palette", {
|
|
93
96
|
action: "create-request",
|
|
94
97
|
payload: {
|
|
95
98
|
documentId: t?.id,
|
|
@@ -97,33 +100,33 @@ const ie = { class: "flex" }, se = {
|
|
|
97
100
|
}
|
|
98
101
|
});
|
|
99
102
|
};
|
|
100
|
-
return (
|
|
103
|
+
return (o, e) => (u(), g("div", ie, [
|
|
101
104
|
l(i(ne), {
|
|
102
|
-
isSidebarOpen:
|
|
103
|
-
"onUpdate:isSidebarOpen": e[3] || (e[3] = (t) =>
|
|
104
|
-
sidebarWidth:
|
|
105
|
-
"onUpdate:sidebarWidth": e[4] || (e[4] = (t) =>
|
|
106
|
-
activeWorkspace:
|
|
107
|
-
documents: Object.values(
|
|
108
|
-
eventBus:
|
|
105
|
+
isSidebarOpen: M.value,
|
|
106
|
+
"onUpdate:isSidebarOpen": e[3] || (e[3] = (t) => M.value = t),
|
|
107
|
+
sidebarWidth: h.value,
|
|
108
|
+
"onUpdate:sidebarWidth": e[4] || (e[4] = (t) => h.value = t),
|
|
109
|
+
activeWorkspace: a.activeWorkspace,
|
|
110
|
+
documents: Object.values(a.store.workspace.documents),
|
|
111
|
+
eventBus: a.eventBus,
|
|
109
112
|
isDroppable: N,
|
|
110
|
-
layout:
|
|
111
|
-
sidebarState:
|
|
112
|
-
workspaces:
|
|
113
|
-
"onCreate:workspace": e[5] || (e[5] = (t) =>
|
|
113
|
+
layout: a.layout,
|
|
114
|
+
sidebarState: a.sidebarState,
|
|
115
|
+
workspaces: a.workspaces,
|
|
116
|
+
"onCreate:workspace": e[5] || (e[5] = (t) => v("create:workspace")),
|
|
114
117
|
onReorder: e[6] || (e[6] = (t, n) => D(t, n)),
|
|
115
|
-
"onSelect:workspace": e[7] || (e[7] = (t) =>
|
|
116
|
-
onSelectItem: e[8] || (e[8] = (t) =>
|
|
118
|
+
"onSelect:workspace": e[7] || (e[7] = (t) => v("select:workspace", t)),
|
|
119
|
+
onSelectItem: e[8] || (e[8] = (t) => v("selectItem", t))
|
|
117
120
|
}, R({
|
|
118
121
|
sidebarMenuActions: r(() => [
|
|
119
|
-
F(
|
|
122
|
+
F(o.$slots, "sidebarMenuActions", {}, void 0, !0)
|
|
120
123
|
]),
|
|
121
124
|
workspaceButton: r(() => [
|
|
122
125
|
l(i(I), {
|
|
123
126
|
is: "button",
|
|
124
|
-
active:
|
|
127
|
+
active: a.isWorkspaceOpen,
|
|
125
128
|
icon: i(Z),
|
|
126
|
-
onClick: e[0] || (e[0] = (t) =>
|
|
129
|
+
onClick: e[0] || (e[0] = (t) => v("click:workspace"))
|
|
127
130
|
}, {
|
|
128
131
|
default: r(() => [
|
|
129
132
|
y(j(A.value), 1)
|
|
@@ -139,15 +142,20 @@ const ie = { class: "flex" }, se = {
|
|
|
139
142
|
label: "More options",
|
|
140
143
|
size: "sm",
|
|
141
144
|
weight: "bold",
|
|
142
|
-
onClick:
|
|
145
|
+
onClick: p((n) => m(n, t), ["stop"]),
|
|
143
146
|
onKeydown: [
|
|
144
|
-
k(
|
|
145
|
-
k(
|
|
146
|
-
k(
|
|
147
|
-
k(
|
|
147
|
+
k(p((n) => m(n, t), ["stop"]), ["down"]),
|
|
148
|
+
k(p((n) => m(n, t), ["stop"]), ["enter"]),
|
|
149
|
+
k(p((n) => m(n, t), ["stop"]), ["space"]),
|
|
150
|
+
k(p((n) => m(n, t), ["stop"]), ["up"])
|
|
148
151
|
]
|
|
149
152
|
}, null, 8, ["icon", "onClick", "onKeydown"])
|
|
150
153
|
]),
|
|
154
|
+
icon: r(({ item: t }) => [
|
|
155
|
+
t.type === "document" && a.store.workspace.documents[t.name]?.["x-scalar-is-dirty"] === !0 ? (u(), g("div", se, [...e[11] || (e[11] = [
|
|
156
|
+
d("div", { class: "h-2 w-2 rounded-full bg-white" }, null, -1)
|
|
157
|
+
])])) : c("", !0)
|
|
158
|
+
]),
|
|
151
159
|
empty: r(({ item: t }) => [
|
|
152
160
|
l(i(I), {
|
|
153
161
|
is: "button",
|
|
@@ -156,7 +164,7 @@ const ie = { class: "flex" }, se = {
|
|
|
156
164
|
icon: r(() => [
|
|
157
165
|
l(i(Q))
|
|
158
166
|
]),
|
|
159
|
-
default: r(() => [...e[
|
|
167
|
+
default: r(() => [...e[12] || (e[12] = [
|
|
160
168
|
y("Add operation", -1)
|
|
161
169
|
])]),
|
|
162
170
|
_: 1
|
|
@@ -164,7 +172,7 @@ const ie = { class: "flex" }, se = {
|
|
|
164
172
|
]),
|
|
165
173
|
_: 2
|
|
166
174
|
}, [
|
|
167
|
-
|
|
175
|
+
a.layout !== "modal" ? {
|
|
168
176
|
name: "footer",
|
|
169
177
|
fn: r(() => [
|
|
170
178
|
d("div", {
|
|
@@ -172,8 +180,8 @@ const ie = { class: "flex" }, se = {
|
|
|
172
180
|
"empty-sidebar-item border-t": S.value
|
|
173
181
|
})
|
|
174
182
|
}, [
|
|
175
|
-
S.value ? (
|
|
176
|
-
d("div",
|
|
183
|
+
S.value ? (u(), g("div", re, [
|
|
184
|
+
d("div", le, [
|
|
177
185
|
l(E, {
|
|
178
186
|
art: i(_),
|
|
179
187
|
class: "rabbitsit font-bold"
|
|
@@ -183,34 +191,34 @@ const ie = { class: "flex" }, se = {
|
|
|
183
191
|
class: "rabbitjump absolute top-0 left-0 font-bold"
|
|
184
192
|
}, null, 8, ["art"])
|
|
185
193
|
]),
|
|
186
|
-
e[
|
|
194
|
+
e[13] || (e[13] = d("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
|
|
187
195
|
d("b", { class: "font-medium" }, "Let's Get Started"),
|
|
188
196
|
d("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
|
|
189
197
|
], -1))
|
|
190
|
-
])) :
|
|
191
|
-
d("div",
|
|
192
|
-
S.value ? (
|
|
198
|
+
])) : c("", !0),
|
|
199
|
+
d("div", de, [
|
|
200
|
+
S.value ? (u(), B(i($), {
|
|
193
201
|
key: 0,
|
|
194
202
|
class: "w-full",
|
|
195
203
|
size: "sm",
|
|
196
|
-
onClick: e[1] || (e[1] = (t) =>
|
|
204
|
+
onClick: e[1] || (e[1] = (t) => a.eventBus.emit("ui:open:command-palette", {
|
|
197
205
|
action: "import-from-openapi-swagger-postman-curl",
|
|
198
206
|
payload: void 0
|
|
199
207
|
}))
|
|
200
208
|
}, {
|
|
201
|
-
default: r(() => [...e[
|
|
209
|
+
default: r(() => [...e[14] || (e[14] = [
|
|
202
210
|
y(" Import Collection ", -1)
|
|
203
211
|
])]),
|
|
204
212
|
_: 1
|
|
205
|
-
})) :
|
|
213
|
+
})) : c("", !0),
|
|
206
214
|
l(i($), {
|
|
207
215
|
class: "w-full",
|
|
208
216
|
hotkey: "K",
|
|
209
217
|
size: "sm",
|
|
210
218
|
variant: "outlined",
|
|
211
|
-
onClick: e[2] || (e[2] = (t) =>
|
|
219
|
+
onClick: e[2] || (e[2] = (t) => a.eventBus.emit("ui:open:command-palette"))
|
|
212
220
|
}, {
|
|
213
|
-
default: r(() => [...e[
|
|
221
|
+
default: r(() => [...e[15] || (e[15] = [
|
|
214
222
|
y(" Add Item ", -1)
|
|
215
223
|
])]),
|
|
216
224
|
_: 1
|
|
@@ -221,34 +229,34 @@ const ie = { class: "flex" }, se = {
|
|
|
221
229
|
key: "0"
|
|
222
230
|
} : void 0
|
|
223
231
|
]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "eventBus", "layout", "sidebarState", "workspaces"]),
|
|
224
|
-
s.value?.showMenu ? (
|
|
232
|
+
s.value?.showMenu ? (u(), B(ae, {
|
|
225
233
|
key: 0,
|
|
226
|
-
eventBus:
|
|
234
|
+
eventBus: a.eventBus,
|
|
227
235
|
item: s.value.item,
|
|
228
|
-
sidebarState:
|
|
236
|
+
sidebarState: a.sidebarState,
|
|
229
237
|
target: s.value.el,
|
|
230
238
|
onCloseMenu: K,
|
|
231
|
-
onShowDeleteModal: e[9] || (e[9] = (t) => i(
|
|
232
|
-
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) :
|
|
233
|
-
s.value ? (
|
|
239
|
+
onShowDeleteModal: e[9] || (e[9] = (t) => i(b).show())
|
|
240
|
+
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) : c("", !0),
|
|
241
|
+
s.value ? (u(), B(i(Y), {
|
|
234
242
|
key: 1,
|
|
235
243
|
size: "xxs",
|
|
236
|
-
state: i(
|
|
244
|
+
state: i(b),
|
|
237
245
|
title: `Delete ${s.value.item.title}`
|
|
238
246
|
}, {
|
|
239
247
|
default: r(() => [
|
|
240
248
|
l(te, {
|
|
241
249
|
variableName: s.value.item.title,
|
|
242
250
|
warningMessage: T.value,
|
|
243
|
-
onClose: e[10] || (e[10] = (t) => i(
|
|
251
|
+
onClose: e[10] || (e[10] = (t) => i(b).hide()),
|
|
244
252
|
onDelete: z
|
|
245
253
|
}, null, 8, ["variableName", "warningMessage"])
|
|
246
254
|
]),
|
|
247
255
|
_: 1
|
|
248
|
-
}, 8, ["state", "title"])) :
|
|
256
|
+
}, 8, ["state", "title"])) : c("", !0)
|
|
249
257
|
]));
|
|
250
258
|
}
|
|
251
259
|
});
|
|
252
260
|
export {
|
|
253
|
-
|
|
261
|
+
ge as default
|
|
254
262
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AAiJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;;AACH,wBAmVC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarButton as
|
|
1
|
+
import { defineComponent as g, computed as f, createElementBlock as i, openBlock as u, createElementVNode as t, createVNode as o, createBlock as p, createCommentVNode as h, unref as l, withCtx as s, resolveDynamicComponent as y, mergeProps as k } from "vue";
|
|
2
|
+
import { ScalarFormError as w, ScalarButton as m } from "@scalar/components";
|
|
3
|
+
import { ScalarIconArrowLeft as b, ScalarIconFloppyDisk as S } from "@scalar/icons";
|
|
3
4
|
import { LibraryIcon as _ } from "@scalar/icons/library";
|
|
4
|
-
import { RouterView as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
5
|
+
import { RouterView as C } from "vue-router";
|
|
6
|
+
import V from "../../../components/IconSelector.vue.js";
|
|
7
|
+
import B from "./components/LabelInput.vue.js";
|
|
8
|
+
import D from "./components/Tabs.vue.js";
|
|
9
|
+
const I = { class: "custom-scroll h-full" }, N = {
|
|
9
10
|
key: 0,
|
|
10
11
|
class: "w-full md:mx-auto md:max-w-[720px]"
|
|
11
|
-
},
|
|
12
|
+
}, U = ["aria-label"], z = { class: "flex" }, E = { class: "flex flex-row items-center gap-2" }, L = { class: "group relative ml-1.25" }, $ = { class: "px-1.5 py-8" }, j = {
|
|
12
13
|
key: 1,
|
|
13
14
|
class: "flex w-full flex-1 items-center justify-center"
|
|
14
|
-
},
|
|
15
|
+
}, F = {
|
|
15
16
|
name: "DocumentCollection"
|
|
16
|
-
},
|
|
17
|
-
...
|
|
17
|
+
}, J = /* @__PURE__ */ g({
|
|
18
|
+
...F,
|
|
18
19
|
props: {
|
|
19
20
|
documentSlug: {},
|
|
20
21
|
document: {},
|
|
@@ -29,31 +30,69 @@ const k = { class: "custom-scroll h-full" }, V = {
|
|
|
29
30
|
activeWorkspace: {},
|
|
30
31
|
plugins: {}
|
|
31
32
|
},
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
() =>
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
setup(a) {
|
|
34
|
+
const n = a, c = f(() => n.document?.info?.title || "Untitled Document"), d = f(
|
|
35
|
+
() => n.document?.["x-scalar-icon"] || "interface-content-folder"
|
|
36
|
+
), v = () => {
|
|
37
|
+
n.workspaceStore.revertDocumentChanges(n.documentSlug);
|
|
38
|
+
}, x = () => {
|
|
39
|
+
n.workspaceStore.saveDocument(n.documentSlug);
|
|
40
|
+
};
|
|
41
|
+
return (T, e) => (u(), i("div", I, [
|
|
42
|
+
a.document ? (u(), i("div", N, [
|
|
43
|
+
t("div", {
|
|
44
|
+
"aria-label": `title: ${c.value}`,
|
|
40
45
|
class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:mx-auto md:max-w-[720px]"
|
|
41
46
|
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
a.document["x-scalar-is-dirty"] ? (u(), p(l(w), {
|
|
48
|
+
key: 0,
|
|
49
|
+
variant: "warning"
|
|
50
|
+
}, {
|
|
51
|
+
default: s(() => [
|
|
52
|
+
e[4] || (e[4] = t("div", null, " You have unsaved changes. Save your work to keep your changes, or undo to revert them. ", -1)),
|
|
53
|
+
e[5] || (e[5] = t("div", { class: "flex-1" }, null, -1)),
|
|
54
|
+
t("div", z, [
|
|
55
|
+
o(l(m), {
|
|
56
|
+
size: "sm",
|
|
57
|
+
variant: "ghost",
|
|
58
|
+
onClick: v
|
|
59
|
+
}, {
|
|
60
|
+
default: s(() => [
|
|
61
|
+
o(l(b)),
|
|
62
|
+
e[2] || (e[2] = t("span", null, "Undo", -1))
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
}),
|
|
66
|
+
o(l(m), {
|
|
67
|
+
size: "sm",
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
onClick: x
|
|
70
|
+
}, {
|
|
71
|
+
default: s(() => [
|
|
72
|
+
o(l(S)),
|
|
73
|
+
e[3] || (e[3] = t("span", null, "Save", -1))
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
})
|
|
77
|
+
])
|
|
78
|
+
]),
|
|
79
|
+
_: 1
|
|
80
|
+
})) : h("", !0),
|
|
81
|
+
t("div", E, [
|
|
82
|
+
o(V, {
|
|
83
|
+
modelValue: d.value,
|
|
45
84
|
placement: "bottom-start",
|
|
46
|
-
"onUpdate:modelValue":
|
|
85
|
+
"onUpdate:modelValue": e[0] || (e[0] = (r) => a.eventBus.emit("document:update:icon", r))
|
|
47
86
|
}, {
|
|
48
|
-
default:
|
|
49
|
-
o(m
|
|
87
|
+
default: s(() => [
|
|
88
|
+
o(l(m), {
|
|
50
89
|
class: "hover:bg-b-2 aspect-square h-7 w-7 cursor-pointer rounded border border-transparent p-0 hover:border-inherit",
|
|
51
90
|
variant: "ghost"
|
|
52
91
|
}, {
|
|
53
|
-
default:
|
|
54
|
-
o(
|
|
92
|
+
default: s(() => [
|
|
93
|
+
o(l(_), {
|
|
55
94
|
class: "text-c-2 size-5",
|
|
56
|
-
src:
|
|
95
|
+
src: d.value,
|
|
57
96
|
"stroke-width": "2"
|
|
58
97
|
}, null, 8, ["src"])
|
|
59
98
|
]),
|
|
@@ -63,33 +102,33 @@ const k = { class: "custom-scroll h-full" }, V = {
|
|
|
63
102
|
_: 1
|
|
64
103
|
}, 8, ["modelValue"])
|
|
65
104
|
]),
|
|
66
|
-
|
|
67
|
-
o(
|
|
105
|
+
t("div", L, [
|
|
106
|
+
o(B, {
|
|
68
107
|
class: "text-xl font-bold",
|
|
69
108
|
inputId: "documentName",
|
|
70
|
-
modelValue:
|
|
71
|
-
"onUpdate:modelValue":
|
|
109
|
+
modelValue: c.value,
|
|
110
|
+
"onUpdate:modelValue": e[1] || (e[1] = (r) => a.eventBus.emit("document:update:info", { title: r }))
|
|
72
111
|
}, null, 8, ["modelValue"])
|
|
73
112
|
])
|
|
74
|
-
], 8,
|
|
75
|
-
o(
|
|
76
|
-
|
|
77
|
-
o(
|
|
78
|
-
default:
|
|
79
|
-
(
|
|
113
|
+
], 8, U),
|
|
114
|
+
o(D, { type: "document" }),
|
|
115
|
+
t("div", $, [
|
|
116
|
+
o(l(C), null, {
|
|
117
|
+
default: s(({ Component: r }) => [
|
|
118
|
+
(u(), p(y(r), k(n, { collectionType: "document" }), null, 16))
|
|
80
119
|
]),
|
|
81
120
|
_: 1
|
|
82
121
|
})
|
|
83
122
|
])
|
|
84
|
-
])) : (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
123
|
+
])) : (u(), i("div", j, [...e[6] || (e[6] = [
|
|
124
|
+
t("div", { class: "flex h-full flex-col items-center justify-center" }, [
|
|
125
|
+
t("h1", { class: "text-2xl font-bold" }, "Document not found"),
|
|
126
|
+
t("p", { class: "text-gray-500" }, " The document you are looking for does not exist. ")
|
|
88
127
|
], -1)
|
|
89
128
|
])]))
|
|
90
129
|
]));
|
|
91
130
|
}
|
|
92
131
|
});
|
|
93
132
|
export {
|
|
94
|
-
|
|
133
|
+
J as default
|
|
95
134
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAiMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM/D;;;;;;;GAOG;;IAGC,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;AAHnC,wBAwPC"}
|
|
@@ -69,7 +69,7 @@ const b = {
|
|
|
69
69
|
type: "document"
|
|
70
70
|
}), h = n(
|
|
71
71
|
() => C(o(e.options)?.hiddenClients)
|
|
72
|
-
), f = "2.
|
|
72
|
+
), f = "2.20.1";
|
|
73
73
|
return (t, a) => e.path && e.method && e.exampleName && l.value ? (c(), x(i(p), {
|
|
74
74
|
key: 0,
|
|
75
75
|
appVersion: i(f),
|
|
@@ -95,8 +95,7 @@ const b = {
|
|
|
95
95
|
server: d.value,
|
|
96
96
|
servers: r.value,
|
|
97
97
|
setOperationSecurity: e.document?.["x-scalar-set-operation-security"] ?? !1,
|
|
98
|
-
|
|
99
|
-
"onUpdate:servers": a[0] || (a[0] = (R) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
|
|
98
|
+
"onUpdate:servers": a[0] || (a[0] = (V) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
|
|
100
99
|
}, null, 8, ["appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (c(), k("div", b, [...a[1] || (a[1] = [
|
|
101
100
|
g("span", { class: "text-c-3" }, "Select an operation to view details", -1)
|
|
102
101
|
])]));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OperationObject,
|
|
1
|
+
import type { OperationObject, PathItemObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
2
|
/** Combine pathItem and operation parameters into a single, dereferenced parameter array */
|
|
3
|
-
export declare const combineParams: (pathParams?: PathItemObject["parameters"], operationParams?: OperationObject["parameters"]) =>
|
|
3
|
+
export declare const combineParams: (pathParams?: PathItemObject["parameters"], operationParams?: OperationObject["parameters"]) => OperationObject["parameters"];
|
|
4
4
|
//# sourceMappingURL=combine-params.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combine-params.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/combine-params.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combine-params.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/combine-params.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAEnH,4FAA4F;AAC5F,eAAO,MAAM,aAAa,GACxB,aAAY,cAAc,CAAC,YAAY,CAAM,EAC7C,kBAAiB,eAAe,CAAC,YAAY,CAAM,KAClD,eAAe,CAAC,YAAY,CAqB9B,CAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
const m = (a = [], r = []) => {
|
|
3
|
+
const o = r.flatMap((t) => {
|
|
4
|
+
const e = n(t);
|
|
5
|
+
return e ? `${e.in}:${e.name}` : [];
|
|
6
|
+
}), s = new Set(o);
|
|
7
|
+
return [...a.filter((t) => {
|
|
8
|
+
const e = n(t);
|
|
9
|
+
return e ? !s.has(`${e.in}:${e.name}`) : !1;
|
|
10
|
+
}), ...r];
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
m as combineParams
|
|
13
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,
|
|
1
|
+
{"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,QAyPA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { generateClientMutators as
|
|
2
|
-
import { computed as
|
|
3
|
-
const r = (a,
|
|
1
|
+
import { generateClientMutators as p } from "@scalar/workspace-store/mutators";
|
|
2
|
+
import { computed as c } from "vue";
|
|
3
|
+
const r = (a, i, t) => async (o) => {
|
|
4
4
|
const n = await t[a]?.onBeforeExecute?.(o) ?? o;
|
|
5
|
-
return await
|
|
5
|
+
return await i(n), await t[a]?.onAfterExecute?.(n), n;
|
|
6
6
|
};
|
|
7
7
|
function l({
|
|
8
8
|
eventBus: a,
|
|
9
|
-
store:
|
|
9
|
+
store: i,
|
|
10
10
|
hooks: t
|
|
11
11
|
}) {
|
|
12
|
-
const o =
|
|
12
|
+
const o = c(() => p(i.value)), n = ({ collectionType: e }) => e === "document" ? o.value.active() : o.value.workspace();
|
|
13
13
|
a.on(
|
|
14
14
|
"workspace:update:active-proxy",
|
|
15
15
|
(e) => r("workspace:update:active-proxy", o.value.workspace().workspace.updateActiveProxy, t)(e)
|
|
@@ -162,6 +162,9 @@ function l({
|
|
|
162
162
|
o.value.active().operation.updateOperationRequestBodyFormValue,
|
|
163
163
|
t
|
|
164
164
|
)(e)
|
|
165
|
+
), a.on(
|
|
166
|
+
"operation:reload:history",
|
|
167
|
+
(e) => r("operation:reload:history", o.value.active().operation.reloadOperationHistory, t)(e)
|
|
165
168
|
), a.on(
|
|
166
169
|
"tag:create:tag",
|
|
167
170
|
(e) => r("tag:create:tag", o.value.active().tag.createTag, t)(e)
|
|
@@ -192,6 +195,9 @@ function l({
|
|
|
192
195
|
), a.on(
|
|
193
196
|
"tabs:update:tabs",
|
|
194
197
|
(e) => r("tabs:update:tabs", o.value.workspace().tabs.updateTabs, t)(e)
|
|
198
|
+
), a.on(
|
|
199
|
+
"hooks:on:request:complete",
|
|
200
|
+
(e) => r("hooks:on:request:complete", o.value.active().operation.addResponseToHistory, t)(e)
|
|
195
201
|
);
|
|
196
202
|
}
|
|
197
203
|
export {
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (u) => {
|
|
35
35
|
u?.createNew && g.name === "request" && p();
|
|
36
|
-
}, v = "2.
|
|
36
|
+
}, v = "2.20.1";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|