@scalar/api-client 2.29.4 → 2.31.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 +95 -0
- package/dist/components/DataTable/DataTableCell.vue.js +1 -1
- package/dist/components/Server/ServerSelector.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerSelector.vue.js +5 -5
- package/dist/components/Sidebar/Sidebar.vue.js +3 -3
- package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +9 -69
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +74 -76
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +15 -8
- 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 +29 -28
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +18 -21
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +22 -21
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +12 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +12 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseBody.vue2.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +13 -8
- 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 +97 -85
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +7 -7
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +7 -7
- package/dist/v2/components/data-table/DataTableCell.vue.js +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +16 -5
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.js +27 -24
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +29 -14
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +57 -57
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue2.js +171 -148
- package/dist/v2/features/app/components/DownloadAppButton.vue.js +1 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue2.js +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +42 -12
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +57 -26
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +6 -0
- package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -0
- package/dist/v2/features/collection/OperationCollection.vue.js +83 -0
- package/dist/v2/features/collection/OperationCollection.vue2.js +4 -0
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
- package/dist/v2/features/collection/components/Authentication.vue2.js +100 -49
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +9 -4
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +12 -10
- package/dist/v2/features/collection/components/Environment.vue.d.ts +9 -4
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +18 -16
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts +6 -2
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
- package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -18
- package/dist/v2/features/collection/components/Overview.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +1 -1
- package/dist/v2/features/collection/components/Overview.vue2.js +177 -75
- package/dist/v2/features/collection/components/Servers.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +154 -98
- package/dist/v2/features/collection/components/Settings.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Tabs.vue.d.ts +2 -1
- package/dist/v2/features/collection/components/Tabs.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Tabs.vue.js +25 -27
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts +12 -0
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts.map +1 -0
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js +13 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +61 -63
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +5 -3
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.js +7 -8
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts +8 -6
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-server.js +2 -2
- package/dist/v2/helpers/drag-handle-factory.d.ts.map +1 -1
- package/dist/v2/helpers/drag-handle-factory.js +41 -41
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +25 -15
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +24 -24
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +17 -17
- package/dist/v2/helpers/remove-circular.d.ts +0 -15
- package/dist/v2/helpers/remove-circular.d.ts.map +0 -1
- package/dist/v2/helpers/remove-circular.js +0 -18
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { debounce as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
1
|
+
import { defineComponent as L, ref as B, computed as h, watchEffect as E, createElementBlock as v, openBlock as i, Fragment as b, createVNode as s, createSlots as j, withCtx as u, createElementVNode as l, normalizeClass as T, renderList as F, createBlock as O, unref as n, toDisplayString as W, createCommentVNode as H, createTextVNode as d } from "vue";
|
|
2
|
+
import { useModal as q, ScalarMarkdown as G, ScalarButton as M, ScalarToggle as J, ScalarModal as K } from "@scalar/components";
|
|
3
|
+
import { debounce as Q } from "@scalar/helpers/general/debounce";
|
|
4
|
+
import { isHttpMethod as C } from "@scalar/helpers/http/is-http-method";
|
|
5
|
+
import { ScalarIconTrash as X, ScalarIconPlus as Y } from "@scalar/icons";
|
|
6
|
+
import { getResolvedRef as Z } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
7
|
+
import _ from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
8
|
+
import ee from "../../settings/components/Section.vue.js";
|
|
9
|
+
import te from "./Form.vue.js";
|
|
10
|
+
import le from "../../../../components/Server/ServerVariablesForm.vue.js";
|
|
11
|
+
const re = { class: "flex h-8 items-center" }, ae = { class: "flex flex-col gap-4" }, oe = { class: "bg-b-2 flex items-center justify-between rounded-t-lg px-3 py-1 text-sm" }, se = {
|
|
10
12
|
key: 1,
|
|
11
13
|
class: "self-center"
|
|
12
|
-
},
|
|
14
|
+
}, ne = { class: "divide-0 flex w-full flex-col divide-y rounded-b-lg text-sm" }, ie = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, ge = /* @__PURE__ */ L({
|
|
13
15
|
__name: "Servers",
|
|
14
16
|
props: {
|
|
15
17
|
documentSlug: {},
|
|
@@ -27,10 +29,12 @@ const q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-cent
|
|
|
27
29
|
customThemes: {},
|
|
28
30
|
collectionType: {}
|
|
29
31
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
setup(t) {
|
|
33
|
+
const g = q(), c = B(-1), m = h(() => t.collectionType === "operation"), S = h(() => !m.value || !t.path || !C(t.method) ? null : Z(t.document?.paths?.[t.path]?.[t.method])), f = B(!1);
|
|
34
|
+
E(() => {
|
|
35
|
+
f.value = S.value?.servers !== void 0;
|
|
36
|
+
});
|
|
37
|
+
const k = h(() => t.collectionType === "operation" && S.value ? S.value.servers ?? [] : t.document?.servers ?? []), N = h(() => k.value[c.value]), o = h(() => t.collectionType === "operation" && t.path && C(t.method) ? { type: "operation", path: t.path, method: t.method } : { type: "document" }), V = [
|
|
34
38
|
{
|
|
35
39
|
label: "URL",
|
|
36
40
|
key: "url",
|
|
@@ -41,103 +45,155 @@ const q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-cent
|
|
|
41
45
|
key: "description",
|
|
42
46
|
placeholder: "Production"
|
|
43
47
|
}
|
|
44
|
-
],
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
], D = (r) => {
|
|
49
|
+
c.value = r, g.show();
|
|
50
|
+
}, w = () => {
|
|
51
|
+
g.hide(), c.value = -1;
|
|
52
|
+
}, R = () => {
|
|
53
|
+
c.value < 0 || (t.eventBus.emit("server:delete:server", {
|
|
54
|
+
index: c.value,
|
|
55
|
+
meta: o.value
|
|
56
|
+
}), w());
|
|
57
|
+
}, { execute: $ } = Q({ delay: 328, maxWait: 1e3 }), A = (r, e, a) => $(
|
|
58
|
+
`${r}-${e}-${o.value.type}`,
|
|
59
|
+
() => t.eventBus.emit("server:update:server", {
|
|
60
|
+
index: r,
|
|
61
|
+
server: { [e]: a },
|
|
62
|
+
meta: o.value
|
|
55
63
|
})
|
|
56
|
-
),
|
|
57
|
-
`${
|
|
58
|
-
() =>
|
|
59
|
-
index:
|
|
64
|
+
), I = (r, e, a) => $(
|
|
65
|
+
`${r}-${e}-${o.value.type}`,
|
|
66
|
+
() => t.eventBus.emit("server:update:variables", {
|
|
67
|
+
index: r,
|
|
60
68
|
key: e,
|
|
61
|
-
value:
|
|
69
|
+
value: a,
|
|
70
|
+
meta: o.value
|
|
62
71
|
})
|
|
63
|
-
),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
])
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
), z = () => t.eventBus.emit("server:add:server", { meta: o.value }), U = (r, e = 0) => r?.description || `Server ${e + 1}`, P = (r) => {
|
|
73
|
+
if (o.value.type === "operation")
|
|
74
|
+
return f.value = r, r ? t.eventBus.emit("server:initialize:servers", {
|
|
75
|
+
meta: o.value
|
|
76
|
+
}) : t.eventBus.emit("server:clear:servers", { meta: o.value });
|
|
77
|
+
};
|
|
78
|
+
return (r, e) => (i(), v(b, null, [
|
|
79
|
+
s(ee, null, j({
|
|
80
|
+
title: u(() => [
|
|
81
|
+
e[0] || (e[0] = d("Servers", -1))
|
|
82
|
+
]),
|
|
83
|
+
description: u(() => [
|
|
84
|
+
m.value ? (i(), v(b, { key: 0 }, [
|
|
85
|
+
e[1] || (e[1] = l("span", { class: "block" }, " Override servers for this operation with the toggle. ", -1)),
|
|
86
|
+
e[2] || (e[2] = l("span", { class: "mt-1 block" }, [
|
|
87
|
+
l("strong", null, "On"),
|
|
88
|
+
d(" — Servers below apply only to this operation. ")
|
|
89
|
+
], -1)),
|
|
90
|
+
e[3] || (e[3] = l("span", { class: "mt-1 block" }, [
|
|
91
|
+
l("strong", null, "Off"),
|
|
92
|
+
d(" — Removes operation servers; this operation uses document or path servers from the OpenAPI spec. ")
|
|
93
|
+
], -1)),
|
|
94
|
+
e[4] || (e[4] = l("span", { class: "text-c-3 mt-1 block" }, [
|
|
95
|
+
d(" Use "),
|
|
96
|
+
l("code", { class: "font-code text-c-2" }, "{variables}"),
|
|
97
|
+
d(" for dynamic URL parts. ")
|
|
98
|
+
], -1))
|
|
99
|
+
], 64)) : (i(), v(b, { key: 1 }, [
|
|
100
|
+
e[5] || (e[5] = d(" Add different base URLs for your API. Use ", -1)),
|
|
101
|
+
e[6] || (e[6] = l("code", { class: "font-code text-c-2" }, "{variables}", -1)),
|
|
102
|
+
e[7] || (e[7] = d(" for dynamic parts. ", -1))
|
|
103
|
+
], 64))
|
|
104
|
+
]),
|
|
105
|
+
default: u(() => [
|
|
106
|
+
l("div", {
|
|
107
|
+
class: T(m.value && !f.value && "cursor-not-allowed")
|
|
108
|
+
}, [
|
|
109
|
+
l("div", {
|
|
110
|
+
class: T([
|
|
111
|
+
"flex flex-col gap-4",
|
|
112
|
+
m.value && !f.value && "pointer-events-none cursor-not-allowed opacity-50 mix-blend-luminosity"
|
|
113
|
+
])
|
|
79
114
|
}, [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
key:
|
|
83
|
-
class: "
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
115
|
+
l("div", ae, [
|
|
116
|
+
(i(!0), v(b, null, F(k.value, (a, p) => (i(), v("div", {
|
|
117
|
+
key: p,
|
|
118
|
+
class: "rounded-lg border"
|
|
119
|
+
}, [
|
|
120
|
+
l("div", oe, [
|
|
121
|
+
a.description ? (i(), O(n(G), {
|
|
122
|
+
key: 0,
|
|
123
|
+
class: "self-center",
|
|
124
|
+
value: a.description
|
|
125
|
+
}, null, 8, ["value"])) : (i(), v("span", se, W(U(a, p)), 1)),
|
|
126
|
+
s(n(M), {
|
|
127
|
+
class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
|
|
128
|
+
"data-testid": "delete-server-button",
|
|
129
|
+
variant: "ghost",
|
|
130
|
+
onClick: (y) => D(p)
|
|
131
|
+
}, {
|
|
132
|
+
default: u(() => [
|
|
133
|
+
s(n(X), { class: "size-3.5" })
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
}, 8, ["onClick"])
|
|
137
|
+
]),
|
|
138
|
+
l("div", ne, [
|
|
139
|
+
s(te, {
|
|
140
|
+
data: a,
|
|
141
|
+
environment: t.environment,
|
|
142
|
+
onUpdate: (y, x) => A(p, y, x),
|
|
143
|
+
options: V
|
|
144
|
+
}, null, 8, ["data", "environment", "onUpdate"]),
|
|
145
|
+
a.variables ? (i(), O(n(le), {
|
|
146
|
+
key: 0,
|
|
147
|
+
variables: a.variables,
|
|
148
|
+
"onUpdate:variable": (y, x) => I(p, y, x)
|
|
149
|
+
}, null, 8, ["variables", "onUpdate:variable"])) : H("", !0)
|
|
150
|
+
])
|
|
151
|
+
]))), 128))
|
|
152
|
+
]),
|
|
153
|
+
l("div", ie, [
|
|
154
|
+
s(n(M), {
|
|
155
|
+
class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
|
|
156
|
+
size: "sm",
|
|
89
157
|
variant: "ghost",
|
|
90
|
-
onClick:
|
|
158
|
+
onClick: z
|
|
91
159
|
}, {
|
|
92
|
-
default:
|
|
93
|
-
|
|
160
|
+
default: u(() => [
|
|
161
|
+
s(n(Y)),
|
|
162
|
+
e[8] || (e[8] = l("span", null, "Add Server", -1))
|
|
94
163
|
]),
|
|
95
164
|
_: 1
|
|
96
|
-
}
|
|
97
|
-
]),
|
|
98
|
-
c("div", J, [
|
|
99
|
-
a(W, {
|
|
100
|
-
data: r,
|
|
101
|
-
environment: o.environment,
|
|
102
|
-
onUpdate: (u, f) => U(d, u, f),
|
|
103
|
-
options: B
|
|
104
|
-
}, null, 8, ["data", "environment", "onUpdate"]),
|
|
105
|
-
r.variables ? (n(), y(s(Y), {
|
|
106
|
-
key: 0,
|
|
107
|
-
variables: r.variables,
|
|
108
|
-
"onUpdate:variable": (u, f) => C(d, u, f)
|
|
109
|
-
}, null, 8, ["variables", "onUpdate:variable"])) : V("", !0)
|
|
165
|
+
})
|
|
110
166
|
])
|
|
111
|
-
]
|
|
112
|
-
])
|
|
113
|
-
c("div", K, [
|
|
114
|
-
a(s(k), {
|
|
115
|
-
class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
|
|
116
|
-
size: "sm",
|
|
117
|
-
variant: "ghost",
|
|
118
|
-
onClick: D
|
|
119
|
-
}, {
|
|
120
|
-
default: i(() => [
|
|
121
|
-
a(s(j)),
|
|
122
|
-
e[2] || (e[2] = c("span", null, "Add Server", -1))
|
|
123
|
-
]),
|
|
124
|
-
_: 1
|
|
125
|
-
})
|
|
126
|
-
])
|
|
167
|
+
], 2)
|
|
168
|
+
], 2)
|
|
127
169
|
]),
|
|
128
|
-
_:
|
|
129
|
-
}
|
|
130
|
-
|
|
170
|
+
_: 2
|
|
171
|
+
}, [
|
|
172
|
+
m.value ? {
|
|
173
|
+
name: "actions",
|
|
174
|
+
fn: u(() => [
|
|
175
|
+
l("div", re, [
|
|
176
|
+
s(n(J), {
|
|
177
|
+
class: "w-4",
|
|
178
|
+
modelValue: f.value,
|
|
179
|
+
"onUpdate:modelValue": P
|
|
180
|
+
}, null, 8, ["modelValue"])
|
|
181
|
+
])
|
|
182
|
+
]),
|
|
183
|
+
key: "0"
|
|
184
|
+
} : void 0
|
|
185
|
+
]), 1024),
|
|
186
|
+
s(n(K), {
|
|
131
187
|
size: "xxs",
|
|
132
|
-
state:
|
|
133
|
-
title: `Delete ${
|
|
188
|
+
state: n(g),
|
|
189
|
+
title: `Delete ${U(N.value, c.value)}`
|
|
134
190
|
}, {
|
|
135
|
-
default:
|
|
136
|
-
|
|
191
|
+
default: u(() => [
|
|
192
|
+
s(_, {
|
|
137
193
|
variableName: "Server",
|
|
138
194
|
warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
|
|
139
|
-
onClose:
|
|
140
|
-
onDelete:
|
|
195
|
+
onClose: w,
|
|
196
|
+
onDelete: R
|
|
141
197
|
})
|
|
142
198
|
]),
|
|
143
199
|
_: 1
|
|
@@ -146,5 +202,5 @@ const q = { class: "flex flex-col gap-4" }, G = { class: "bg-b-2 flex items-cent
|
|
|
146
202
|
}
|
|
147
203
|
});
|
|
148
204
|
export {
|
|
149
|
-
|
|
205
|
+
ge as default
|
|
150
206
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare const __VLS_export: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
2
|
-
collectionType: "document";
|
|
2
|
+
collectionType: "document" | "operation";
|
|
3
3
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
4
4
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
5
5
|
collectionType: "workspace";
|
|
6
6
|
document: null;
|
|
7
7
|
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
8
|
-
collectionType: "document";
|
|
8
|
+
collectionType: "document" | "operation";
|
|
9
9
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
10
10
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
11
11
|
collectionType: "workspace";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { CollectionProps } from '../../../../v2/features/app/helpers/routes.js';
|
|
1
2
|
type __VLS_Props = {
|
|
2
|
-
type: '
|
|
3
|
+
type: CollectionProps['collectionType'];
|
|
3
4
|
};
|
|
4
5
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
6
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Tabs.vue"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;CACxC,CAAC;AAkHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as l, computed as u, createElementBlock as n, openBlock as r, Fragment as m, renderList as p, createBlock as f, unref as d, withCtx as h, createElementVNode as o, normalizeClass as v, toDisplayString as x, capitalize as k } from "vue";
|
|
2
|
+
import { RouterLink as b } from "vue-router";
|
|
3
|
+
const w = { class: "flex w-full gap-2 border-b pl-1.5 md:ml-1.5 md:pl-0" }, _ = ["href", "onClick"], z = /* @__PURE__ */ l({
|
|
4
4
|
__name: "Tabs",
|
|
5
5
|
props: {
|
|
6
6
|
type: {}
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
const s =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(t(!0), n(p, null, u(s.value, (e) => (t(), d(f(_), {
|
|
21
|
-
key: e,
|
|
8
|
+
setup(e) {
|
|
9
|
+
const s = u(() => e.type === "workspace" ? ["environment", "cookies", "settings"] : e.type === "operation" ? ["overview", "servers", "authentication"] : [
|
|
10
|
+
"overview",
|
|
11
|
+
"servers",
|
|
12
|
+
"authentication",
|
|
13
|
+
"environment",
|
|
14
|
+
"cookies",
|
|
15
|
+
"settings"
|
|
16
|
+
]);
|
|
17
|
+
return (y, g) => (r(), n("div", w, [
|
|
18
|
+
(r(!0), n(m, null, p(s.value, (t) => (r(), f(d(b), {
|
|
19
|
+
key: t,
|
|
22
20
|
custom: "",
|
|
23
|
-
to: { name: `${
|
|
21
|
+
to: { name: `${e.type}.${t}` }
|
|
24
22
|
}, {
|
|
25
|
-
default:
|
|
26
|
-
|
|
23
|
+
default: h(({ isActive: i, href: c, navigate: a }) => [
|
|
24
|
+
o("a", {
|
|
27
25
|
class: "-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline",
|
|
28
|
-
href:
|
|
29
|
-
onClick:
|
|
26
|
+
href: c,
|
|
27
|
+
onClick: a
|
|
30
28
|
}, [
|
|
31
|
-
|
|
32
|
-
class:
|
|
29
|
+
o("span", {
|
|
30
|
+
class: v([
|
|
33
31
|
"flex-center hover:text-c-1 h-full border-b",
|
|
34
|
-
|
|
32
|
+
i ? "text-c-1 border-c-1" : "text-c-2 hover:text-c-1 border-transparent"
|
|
35
33
|
])
|
|
36
|
-
}, k(
|
|
37
|
-
], 8,
|
|
34
|
+
}, x(k(t)), 3)
|
|
35
|
+
], 8, _)
|
|
38
36
|
]),
|
|
39
37
|
_: 2
|
|
40
38
|
}, 1032, ["to"]))), 128))
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthStore } from '@scalar/workspace-store/entities/auth';
|
|
2
|
+
import type { AuthMeta } from '@scalar/workspace-store/events';
|
|
3
|
+
/**
|
|
4
|
+
* Determines the default toggle state for operation security.
|
|
5
|
+
* Returns false for 'document' type, undefined if path/method is missing,
|
|
6
|
+
* otherwise checks if there are selected auth schemas for the operation.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getDefaultOperationSecurityToggle: ({ authStore, documentName, ...payload }: {
|
|
9
|
+
authStore: AuthStore;
|
|
10
|
+
documentName: string;
|
|
11
|
+
} & AuthMeta) => boolean;
|
|
12
|
+
//# sourceMappingURL=get-default-operation-security-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-default-operation-security-toggle.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/helpers/get-default-operation-security-toggle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,GAAI,yCAI/C;IACD,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;CACrB,GAAG,QAAQ,YAeX,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const r = ({
|
|
2
|
+
authStore: t,
|
|
3
|
+
documentName: o,
|
|
4
|
+
...e
|
|
5
|
+
}) => e.type === "document" ? !1 : t.getAuthSelectedSchemas({
|
|
6
|
+
type: "operation",
|
|
7
|
+
documentName: o,
|
|
8
|
+
path: e.path,
|
|
9
|
+
method: e.method
|
|
10
|
+
}) !== void 0;
|
|
11
|
+
export {
|
|
12
|
+
r as getDefaultOperationSecurityToggle
|
|
13
|
+
};
|
|
@@ -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":"AA6OA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAO/D;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;iGA0R/B,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getResolvedRef as
|
|
3
|
-
import { mapHiddenClientsConfig as
|
|
4
|
-
import { combineParams as
|
|
5
|
-
import { getSelectedServer as
|
|
6
|
-
import { getActiveProxyUrl as
|
|
7
|
-
import { getServers as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as w, computed as t, toValue as a, createBlock as C, createElementBlock as B, openBlock as m, unref as c, createElementVNode as U } from "vue";
|
|
2
|
+
import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { mapHiddenClientsConfig as b } from "../modal/helpers/map-hidden-clients-config.js";
|
|
4
|
+
import { combineParams as N } from "./helpers/combine-params.js";
|
|
5
|
+
import { getSelectedServer as M } from "./helpers/get-selected-server.js";
|
|
6
|
+
import { getActiveProxyUrl as A } from "../../helpers/get-active-proxy-url.js";
|
|
7
|
+
import { getServers as E } from "../../helpers/get-servers.js";
|
|
8
|
+
import V from "../../blocks/operation-block/OperationBlock.vue.js";
|
|
9
|
+
const P = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "flex h-full w-full items-center justify-center"
|
|
12
|
-
},
|
|
13
|
-
...
|
|
12
|
+
}, R = {}, $ = /* @__PURE__ */ w({
|
|
13
|
+
...R,
|
|
14
14
|
__name: "Operation",
|
|
15
15
|
props: {
|
|
16
16
|
documentSlug: {},
|
|
@@ -29,94 +29,92 @@ const A = {
|
|
|
29
29
|
options: {}
|
|
30
30
|
},
|
|
31
31
|
setup(e) {
|
|
32
|
-
const
|
|
32
|
+
const l = t(() => e.path ? s(e.document?.paths?.[e.path]) : null), r = t(() => {
|
|
33
33
|
if (!e.path || !e.method)
|
|
34
34
|
return null;
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
35
|
+
const n = s(e.document?.paths?.[e.path]?.[e.method]);
|
|
36
|
+
if (!n)
|
|
37
37
|
return null;
|
|
38
|
-
if (!
|
|
39
|
-
return
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
if (!l.value)
|
|
39
|
+
return n;
|
|
40
|
+
const o = N(
|
|
41
|
+
l.value.parameters,
|
|
42
|
+
n.parameters
|
|
43
43
|
);
|
|
44
|
-
return { ...
|
|
45
|
-
}),
|
|
46
|
-
...(e.workspaceStore.workspace?.["x-scalar-cookies"] ?? []).map((
|
|
47
|
-
...
|
|
44
|
+
return { ...n, parameters: o };
|
|
45
|
+
}), d = t(() => [
|
|
46
|
+
...(e.workspaceStore.workspace?.["x-scalar-cookies"] ?? []).map((n) => ({
|
|
47
|
+
...n,
|
|
48
48
|
location: "workspace"
|
|
49
49
|
})),
|
|
50
|
-
...(e.document?.["x-scalar-cookies"] ?? []).map((
|
|
51
|
-
...
|
|
50
|
+
...(e.document?.["x-scalar-cookies"] ?? []).map((n) => ({
|
|
51
|
+
...n,
|
|
52
52
|
location: "document"
|
|
53
53
|
}))
|
|
54
|
-
]),
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
]), u = t(() => {
|
|
55
|
+
const n = a(e.options)?.servers ?? r.value?.servers ?? // pathItem.value?.servers ?? TODO: add support for pathItem servers
|
|
56
|
+
e.document?.servers;
|
|
57
|
+
return E(n, {
|
|
58
|
+
baseServerUrl: a(e.options)?.baseServerURL,
|
|
58
59
|
documentUrl: e.document?.["x-scalar-original-source-url"]
|
|
59
60
|
});
|
|
60
|
-
}),
|
|
61
|
-
() =>
|
|
62
|
-
),
|
|
61
|
+
}), v = t(() => a(e.options)?.servers != null ? e.document?.["x-scalar-selected-server"] : r.value?.servers != null ? r.value["x-scalar-selected-server"] : e.document?.["x-scalar-selected-server"]), h = t(
|
|
62
|
+
() => M(u.value, v.value)
|
|
63
|
+
), S = t(() => r.value?.servers != null ? { type: "operation", path: e.path ?? "", method: e.method ?? "get" } : { type: "document" }), y = t(() => e.workspaceStore.auth.getAuthSelectedSchemas({
|
|
64
|
+
type: "document",
|
|
65
|
+
documentName: e.documentSlug
|
|
66
|
+
})), i = t(() => e.workspaceStore.auth.getAuthSelectedSchemas({
|
|
63
67
|
type: "operation",
|
|
68
|
+
documentName: e.documentSlug,
|
|
64
69
|
path: e.path ?? "",
|
|
65
70
|
method: e.method ?? "get"
|
|
66
|
-
}
|
|
67
|
-
type: "
|
|
68
|
-
|
|
71
|
+
})), f = t(() => i.value !== void 0 ? {
|
|
72
|
+
type: "operation",
|
|
73
|
+
path: e.path ?? "",
|
|
74
|
+
method: e.method ?? "get"
|
|
75
|
+
} : { type: "document" }), k = t(() => Array.from(
|
|
69
76
|
new Set(
|
|
70
77
|
Object.keys({
|
|
71
78
|
...e.document?.["x-scalar-environments"],
|
|
72
79
|
...e.workspaceStore.workspace["x-scalar-environments"]
|
|
73
80
|
})
|
|
74
81
|
)
|
|
75
|
-
)),
|
|
76
|
-
() =>
|
|
77
|
-
),
|
|
78
|
-
return (
|
|
82
|
+
)), x = t(
|
|
83
|
+
() => b(a(e.options)?.hiddenClients)
|
|
84
|
+
), g = "2.31.1";
|
|
85
|
+
return (n, o) => e.path && e.method && e.exampleName && r.value ? (m(), C(c(V), {
|
|
79
86
|
key: 0,
|
|
80
87
|
activeEnvironment: e.workspaceStore.workspace["x-scalar-active-environment"],
|
|
81
|
-
appVersion:
|
|
82
|
-
authMeta:
|
|
88
|
+
appVersion: c(g),
|
|
89
|
+
authMeta: f.value,
|
|
83
90
|
documentSecurity: e.document?.security ?? [],
|
|
84
|
-
documentSelectedSecurity:
|
|
85
|
-
type: "document",
|
|
86
|
-
documentName: e.documentSlug
|
|
87
|
-
}),
|
|
91
|
+
documentSelectedSecurity: y.value,
|
|
88
92
|
documentUrl: e.document?.["x-scalar-original-source-url"],
|
|
89
93
|
environment: e.environment,
|
|
90
|
-
environments:
|
|
94
|
+
environments: k.value,
|
|
91
95
|
eventBus: e.eventBus,
|
|
92
96
|
exampleKey: e.exampleName,
|
|
93
|
-
globalCookies:
|
|
94
|
-
hideClientButton:
|
|
97
|
+
globalCookies: d.value,
|
|
98
|
+
hideClientButton: a(e.options)?.hideClientButton ?? !1,
|
|
95
99
|
history: e.workspaceStore.history.getHistory(e.documentSlug, e.path, e.method),
|
|
96
|
-
httpClients:
|
|
100
|
+
httpClients: x.value,
|
|
97
101
|
layout: e.layout,
|
|
98
102
|
method: e.method,
|
|
99
|
-
operation:
|
|
100
|
-
operationSelectedSecurity:
|
|
101
|
-
type: "operation",
|
|
102
|
-
documentName: e.documentSlug,
|
|
103
|
-
path: e.path,
|
|
104
|
-
method: e.method
|
|
105
|
-
}),
|
|
103
|
+
operation: r.value,
|
|
104
|
+
operationSelectedSecurity: i.value,
|
|
106
105
|
path: e.path,
|
|
107
106
|
plugins: e.plugins,
|
|
108
|
-
proxyUrl:
|
|
107
|
+
proxyUrl: c(A)(
|
|
109
108
|
e.workspaceStore.workspace["x-scalar-active-proxy"],
|
|
110
109
|
e.layout
|
|
111
110
|
) ?? "",
|
|
112
111
|
securitySchemes: e.securitySchemes,
|
|
113
112
|
selectedClient: e.workspaceStore.workspace["x-scalar-default-client"],
|
|
114
|
-
server:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
x("span", { class: "text-c-3" }, "Select an operation to view details", -1)
|
|
113
|
+
server: h.value,
|
|
114
|
+
serverMeta: S.value,
|
|
115
|
+
servers: u.value
|
|
116
|
+
}, null, 8, ["activeEnvironment", "appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "environments", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "history", "httpClients", "layout", "method", "operation", "operationSelectedSecurity", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "serverMeta", "servers"])) : (m(), B("div", P, [...o[0] || (o[0] = [
|
|
117
|
+
U("span", { class: "text-c-3" }, "Select an operation to view details", -1)
|
|
120
118
|
])]));
|
|
121
119
|
}
|
|
122
120
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth';
|
|
2
2
|
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Resolves which security selection to use for an operation.
|
|
5
|
+
* Priority: operation-level selection, then document-level selection, then a default.
|
|
6
|
+
* When neither level has a selection, returns the first security requirement unless
|
|
7
|
+
* authentication is optional or there are no requirements, in which case returns no selection.
|
|
6
8
|
*/
|
|
7
|
-
export declare const getSelectedSecurity: (documentSelectedSecurity: SelectedSecurity | undefined, operationSelectedSecurity: SelectedSecurity | undefined, securityRequirements?: NonNullable<OpenApiDocument["security"]
|
|
9
|
+
export declare const getSelectedSecurity: (documentSelectedSecurity: SelectedSecurity | undefined, operationSelectedSecurity: SelectedSecurity | undefined, securityRequirements?: NonNullable<OpenApiDocument["security"]>) => SelectedSecurity;
|
|
8
10
|
//# sourceMappingURL=get-selected-security.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAInG
|
|
1
|
+
{"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAInG;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,0BAA0B,gBAAgB,GAAG,SAAS,EACtD,2BAA2B,gBAAgB,GAAG,SAAS,EACvD,uBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAM,KAClE,gBA0BF,CAAA"}
|