@scalar/api-client 2.3.34 → 2.4.2
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 +67 -0
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +74 -89
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +4 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +2 -0
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.js +19 -18
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +3 -3
- package/dist/components/TopNav/TopNavItem.vue2.js +46 -54
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/hooks/useClientConfig.d.ts +72 -6
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +45 -40
- package/dist/layouts/App/create-api-client-app.d.ts +72 -52
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +144 -104
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +49 -44
- package/dist/layouts/Web/create-api-client-web.d.ts +72 -52
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +72 -52
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +53 -49
- package/dist/libs/electron.d.ts +5 -0
- package/dist/libs/electron.d.ts.map +1 -0
- package/dist/libs/electron.js +4 -0
- package/dist/libs/find-request.d.ts +2 -0
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-query-params.d.ts +10 -3
- package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-query-params.js +28 -6
- package/dist/libs/send-request/create-request-operation.d.ts +3 -1
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +91 -87
- package/dist/libs/send-request/create-request-operation.test.d.ts +2 -0
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/plugins/hooks/usePluginManager.d.ts +8 -0
- package/dist/plugins/hooks/usePluginManager.d.ts.map +1 -0
- package/dist/plugins/hooks/usePluginManager.js +10 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +7 -0
- package/dist/plugins/plugin-manager.d.ts +28 -0
- package/dist/plugins/plugin-manager.d.ts.map +1 -0
- package/dist/plugins/plugin-manager.js +24 -0
- package/dist/store/active-entities.d.ts +2 -0
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/request-example.d.ts +4 -4
- package/dist/store/requests.d.ts +26 -4
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +24 -24
- package/dist/store/store.d.ts +72 -52
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/tags.d.ts +4 -4
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +47 -45
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +37 -34
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +61 -70
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +92 -77
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +59 -65
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +34 -35
- package/dist/views/Request/RequestSection/types/post-response.d.ts +7 -0
- package/dist/views/Request/RequestSection/types/post-response.d.ts.map +1 -0
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItem.vue2.js +132 -134
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +82 -70
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -114
- package/package.json +25 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":"AAuIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AASnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AASrF,KAAK,WAAW,GAAG;IACf,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,aAAa,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACzC,CAAC;;;cAI0C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAsNjE,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Request.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-351e187b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAuQ8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAsTjE,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestRoot.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fdd31891"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { safeJSON as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
7
|
-
import { useClientConfig as
|
|
8
|
-
import { useSidebar as
|
|
9
|
-
import { validateParameters as
|
|
10
|
-
import { useActiveEntities as
|
|
11
|
-
import { useOpenApiWatcher as
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { defineComponent as F, ref as m, computed as G, onMounted as K, onBeforeUnmount as X, watch as Y, createElementBlock as Z, openBlock as d, normalizeClass as V, unref as r, createBlock as B, createCommentVNode as T, createElementVNode as A, isRef as ee, createVNode as te } from "vue";
|
|
2
|
+
import { isDefined as oe } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { safeJSON as re } from "@scalar/object-utils/parse";
|
|
4
|
+
import { useToasts as se } from "@scalar/use-toasts";
|
|
5
|
+
import { RouterView as ae } from "vue-router";
|
|
6
|
+
import le from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
7
|
+
import { useClientConfig as ne } from "../../hooks/useClientConfig.js";
|
|
8
|
+
import { useSidebar as ue } from "../../hooks/useSidebar.js";
|
|
9
|
+
import { validateParameters as ie } from "../../libs/validate-parameters.js";
|
|
10
|
+
import { useActiveEntities as ce } from "../../store/active-entities.js";
|
|
11
|
+
import { useOpenApiWatcher as me } from "./hooks/useOpenApiWatcher.js";
|
|
12
|
+
import fe from "./RequestSidebar.vue.js";
|
|
13
|
+
import { usePluginManager as de } from "../../plugins/hooks/usePluginManager.js";
|
|
14
|
+
import { createRequestOperation as pe } from "../../libs/send-request/create-request-operation.js";
|
|
15
|
+
import { ERRORS as ve } from "../../libs/errors.js";
|
|
16
|
+
import { useWorkspace as Se } from "../../store/store.js";
|
|
17
|
+
import { useLayout as Re } from "../../hooks/useLayout.js";
|
|
18
|
+
const ye = { class: "flex h-full" }, qe = { class: "flex h-full flex-1 flex-col" }, Me = /* @__PURE__ */ F({
|
|
18
19
|
__name: "RequestRoot",
|
|
19
20
|
emits: ["newTab"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
21
|
+
setup(xe) {
|
|
22
|
+
const P = Se(), { toast: p } = se(), { layout: v } = Re(), D = ne(), { isSidebarOpen: s } = ue(), {
|
|
22
23
|
activeCollection: l,
|
|
23
24
|
activeExample: n,
|
|
24
25
|
activeEnvironment: S,
|
|
25
26
|
activeRequest: u,
|
|
26
27
|
activeWorkspace: R,
|
|
27
|
-
activeServer:
|
|
28
|
-
} =
|
|
28
|
+
activeServer: M
|
|
29
|
+
} = ce(), { cookies: z, requestHistory: I, showSidebar: y, securitySchemes: J, events: i } = P, W = de(), j = m(), q = m(), f = m(/* @__PURE__ */ new Set()), x = m(null), b = G(
|
|
29
30
|
() => {
|
|
30
31
|
var e, t, o;
|
|
31
32
|
return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = u.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
|
|
32
33
|
}
|
|
33
34
|
), h = async () => {
|
|
34
|
-
var U, _, w,
|
|
35
|
+
var N, U, _, w, c, O;
|
|
35
36
|
if (!u.value || !n.value || !l.value)
|
|
36
37
|
return;
|
|
37
|
-
f.value =
|
|
38
|
-
const e = typeof S.value == "object" ? S.value.value : "{}", t =
|
|
38
|
+
f.value = ie(n.value);
|
|
39
|
+
const e = typeof S.value == "object" ? S.value.value : "{}", t = re.parse(e);
|
|
39
40
|
t.error && console.error("INVALID ENVIRONMENT!");
|
|
40
|
-
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((
|
|
41
|
+
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((N = R.value) == null ? void 0 : N.cookies.map((Q) => z[Q]).filter(oe)) ?? [], H = ((_ = (U = l.value) == null ? void 0 : U.info) == null ? void 0 : _.title) === "Drafts" ? void 0 : M.value, [k, E] = pe({
|
|
41
42
|
request: u.value,
|
|
42
43
|
example: n.value,
|
|
43
44
|
selectedSecuritySchemeUids: b.value,
|
|
44
|
-
proxyUrl: ((
|
|
45
|
+
proxyUrl: ((w = R.value) == null ? void 0 : w.proxyUrl) ?? "",
|
|
45
46
|
environment: o,
|
|
46
47
|
globalCookies: a,
|
|
47
48
|
status: i.requestStatus,
|
|
48
|
-
securitySchemes:
|
|
49
|
-
server:
|
|
49
|
+
securitySchemes: J,
|
|
50
|
+
server: H,
|
|
51
|
+
pluginManager: W
|
|
50
52
|
});
|
|
51
|
-
if ((
|
|
53
|
+
if ((O = (c = D.value) == null ? void 0 : c.onRequestSent) == null || O.call(c, u.value.path ?? ""), k) {
|
|
52
54
|
p(k.message, "error");
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
57
|
q.value = E.controller;
|
|
56
|
-
const [
|
|
57
|
-
x.value =
|
|
58
|
+
const [g, C] = await E.sendRequest();
|
|
59
|
+
x.value = C, g ? p(g.message, "error") : I.push($(C));
|
|
58
60
|
}, L = async () => {
|
|
59
61
|
var e;
|
|
60
|
-
return (e = q.value) == null ? void 0 : e.abort(
|
|
62
|
+
return (e = q.value) == null ? void 0 : e.abort(ve.REQUEST_ABORTED);
|
|
61
63
|
};
|
|
62
|
-
|
|
64
|
+
K(() => {
|
|
63
65
|
i.executeRequest.on(h), i.cancelRequest.on(L);
|
|
64
|
-
}),
|
|
66
|
+
}), me(), X(() => i.executeRequest.off(h)), Y(
|
|
65
67
|
() => {
|
|
66
68
|
var e;
|
|
67
69
|
return (e = n.value) == null ? void 0 : e.parameters;
|
|
@@ -71,7 +73,7 @@ const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col"
|
|
|
71
73
|
},
|
|
72
74
|
{ deep: !0 }
|
|
73
75
|
);
|
|
74
|
-
const
|
|
76
|
+
const $ = (e) => {
|
|
75
77
|
var t;
|
|
76
78
|
try {
|
|
77
79
|
return structuredClone(e);
|
|
@@ -80,30 +82,30 @@ const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col"
|
|
|
80
82
|
return (t = e.response) != null && t.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? a.response.data = e.response.data : a.response.data = JSON.parse(JSON.stringify(e.response.data))), a;
|
|
81
83
|
}
|
|
82
84
|
};
|
|
83
|
-
return (e, t) => (d(),
|
|
85
|
+
return (e, t) => (d(), Z("div", {
|
|
84
86
|
ref_key: "element",
|
|
85
87
|
ref: j,
|
|
86
|
-
class:
|
|
88
|
+
class: V(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
|
|
87
89
|
"!mb-0 !mr-0 !border-0": r(v) === "modal"
|
|
88
90
|
}])
|
|
89
91
|
}, [
|
|
90
|
-
r(y) ? (d(), B(
|
|
92
|
+
r(y) ? (d(), B(le, {
|
|
91
93
|
key: 0,
|
|
92
94
|
modelValue: r(s),
|
|
93
|
-
"onUpdate:modelValue": t[0] || (t[0] = (o) =>
|
|
94
|
-
class:
|
|
95
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => ee(s) ? s.value = o : null),
|
|
96
|
+
class: V(["absolute left-3 top-2 z-50", [
|
|
95
97
|
{ hidden: r(s) },
|
|
96
98
|
{ "xl:!flex": !r(s) },
|
|
97
99
|
{ "!flex": r(v) === "modal" }
|
|
98
100
|
]])
|
|
99
101
|
}, null, 8, ["modelValue", "class"])) : T("", !0),
|
|
100
|
-
A("div",
|
|
101
|
-
r(y) ? (d(), B(
|
|
102
|
+
A("div", ye, [
|
|
103
|
+
r(y) ? (d(), B(fe, {
|
|
102
104
|
key: 0,
|
|
103
105
|
onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
|
|
104
106
|
})) : T("", !0),
|
|
105
|
-
A("div",
|
|
106
|
-
|
|
107
|
+
A("div", qe, [
|
|
108
|
+
te(r(ae), {
|
|
107
109
|
invalidParams: f.value,
|
|
108
110
|
selectedSecuritySchemeUids: b.value,
|
|
109
111
|
requestResult: x.value
|
|
@@ -114,5 +116,5 @@ const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col"
|
|
|
114
116
|
}
|
|
115
117
|
});
|
|
116
118
|
export {
|
|
117
|
-
|
|
119
|
+
Me as default
|
|
118
120
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue"],"names":[],"mappings":"AAuNA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,qBAAqB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAoNF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./RequestAuthDataTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const f = /* @__PURE__ */
|
|
3
|
+
import a from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const f = /* @__PURE__ */ a(t, [["__scopeId", "data-v-3f02bac6"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { defineComponent as b, ref as
|
|
1
|
+
import { defineComponent as b, ref as m, computed as y, watch as k, createElementBlock as l, openBlock as o, withModifiers as w, createCommentVNode as p, createBlock as g, createVNode as h, normalizeClass as s, Fragment as S, renderList as x, createElementVNode as v, toDisplayString as A, unref as i, withCtx as C } from "vue";
|
|
2
2
|
import { useModal as V } from "@scalar/components";
|
|
3
3
|
import O from "./DeleteRequestAuthModal.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "box-content flex h-8 flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3"
|
|
9
|
-
}, M = ["onClick"], N = { class: "relative z-10 whitespace-nowrap font-medium" }, $ = {
|
|
4
|
+
import z from "./RequestAuthTab.vue.js";
|
|
5
|
+
import B from "../../../../components/DataTable/DataTable.vue.js";
|
|
6
|
+
const M = ["onClick"], N = { class: "relative z-10 whitespace-nowrap font-medium" }, $ = {
|
|
10
7
|
key: 0,
|
|
11
8
|
class: "z-1 absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 h-px w-full -translate-x-1/2 bg-current"
|
|
12
|
-
},
|
|
13
|
-
key: 2,
|
|
14
|
-
class: "text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t px-4 text-sm"
|
|
15
|
-
}, F = /* @__PURE__ */ b({
|
|
9
|
+
}, j = /* @__PURE__ */ b({
|
|
16
10
|
__name: "RequestAuthDataTable",
|
|
17
11
|
props: {
|
|
18
12
|
collection: {},
|
|
@@ -24,68 +18,77 @@ const B = {
|
|
|
24
18
|
server: {},
|
|
25
19
|
workspace: {}
|
|
26
20
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
21
|
+
setup(c) {
|
|
22
|
+
const u = V(), f = m(
|
|
29
23
|
null
|
|
30
|
-
), t =
|
|
31
|
-
const e =
|
|
24
|
+
), t = m(0), d = y(() => {
|
|
25
|
+
const e = c.selectedSchemeOptions[t.value];
|
|
32
26
|
if (!e)
|
|
33
27
|
return [];
|
|
34
28
|
const r = e == null ? void 0 : e.id.split(",");
|
|
35
29
|
return r.length > 1 ? r : [e.id];
|
|
36
30
|
});
|
|
37
31
|
return k(
|
|
38
|
-
() =>
|
|
32
|
+
() => c.selectedSchemeOptions,
|
|
39
33
|
(e) => {
|
|
40
34
|
e[t.value] || (t.value = Math.max(0, t.value - 1));
|
|
41
35
|
}
|
|
42
|
-
), (e, r) => (
|
|
36
|
+
), (e, r) => (o(), l("form", {
|
|
43
37
|
onSubmit: r[1] || (r[1] = w(() => {
|
|
44
38
|
}, ["prevent"]))
|
|
45
39
|
}, [
|
|
46
|
-
e.selectedSchemeOptions.length > 1 ? (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
e.selectedSchemeOptions.length > 1 ? (o(), l("div", {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: s(["box-content flex h-8 flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", e.layout === "client" && "border-r-0"])
|
|
43
|
+
}, [
|
|
44
|
+
(o(!0), l(S, null, x(e.selectedSchemeOptions, (n, a) => (o(), l("div", {
|
|
45
|
+
key: n.id,
|
|
46
|
+
class: s(["z-1 relative -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer", [t.value === a ? "text-c-1" : "text-c-3"]])
|
|
50
47
|
}, [
|
|
51
48
|
v("button", {
|
|
52
49
|
class: "floating-bg relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium",
|
|
53
50
|
type: "button",
|
|
54
|
-
onClick: (
|
|
51
|
+
onClick: (q) => t.value = a
|
|
55
52
|
}, [
|
|
56
|
-
v("span", N, A(
|
|
53
|
+
v("span", N, A(n.label), 1)
|
|
57
54
|
], 8, M),
|
|
58
|
-
t.value ===
|
|
55
|
+
t.value === a ? (o(), l("div", $)) : p("", !0)
|
|
59
56
|
], 2))), 128))
|
|
60
|
-
])) :
|
|
61
|
-
|
|
57
|
+
], 2)) : p("", !0),
|
|
58
|
+
d.value.length ? (o(), g(i(B), {
|
|
62
59
|
key: 1,
|
|
63
|
-
class:
|
|
60
|
+
class: s(["flex-1", e.layout === "reference" && "rounded-b-lg border border-t-0"]),
|
|
64
61
|
columns: [""],
|
|
65
62
|
presentational: ""
|
|
66
63
|
}, {
|
|
67
64
|
default: C(() => [
|
|
68
|
-
|
|
65
|
+
h(z, {
|
|
69
66
|
collection: e.collection,
|
|
70
67
|
envVariables: e.envVariables,
|
|
71
68
|
environment: e.environment,
|
|
72
69
|
layout: e.layout,
|
|
73
70
|
persistAuth: e.persistAuth,
|
|
74
|
-
securitySchemeUids:
|
|
71
|
+
securitySchemeUids: d.value,
|
|
75
72
|
server: e.server,
|
|
76
73
|
workspace: e.workspace
|
|
77
74
|
}, null, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "securitySchemeUids", "server", "workspace"])
|
|
78
75
|
]),
|
|
79
76
|
_: 1
|
|
80
|
-
}, 8, ["class"])) : (
|
|
81
|
-
|
|
77
|
+
}, 8, ["class"])) : (o(), l("div", {
|
|
78
|
+
key: 2,
|
|
79
|
+
class: s([
|
|
80
|
+
"text-c-3 bg-b-1 flex min-h-16 items-center justify-center border-t px-4 text-sm",
|
|
81
|
+
e.layout === "reference" && "min-h-[calc(4rem+0.5px)] rounded-b-lg border"
|
|
82
|
+
])
|
|
83
|
+
}, " No authentication selected ", 2)),
|
|
84
|
+
h(O, {
|
|
82
85
|
scheme: f.value,
|
|
83
|
-
state:
|
|
84
|
-
onClose: r[0] || (r[0] = (
|
|
86
|
+
state: i(u),
|
|
87
|
+
onClose: r[0] || (r[0] = (n) => i(u).hide())
|
|
85
88
|
}, null, 8, ["scheme", "state"])
|
|
86
89
|
], 32));
|
|
87
90
|
}
|
|
88
91
|
});
|
|
89
92
|
export {
|
|
90
|
-
|
|
93
|
+
j as default
|
|
91
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAmPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK1D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,cAAc,CAAA;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAC;;AAwVF,wBAOG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarTooltip as W, ScalarButton as
|
|
3
|
-
import { requestExampleParametersSchema as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as S, computed as m, onMounted as N, nextTick as p, ref as x, watch as A, createBlock as d, openBlock as v, withCtx as i, createElementVNode as f, createCommentVNode as h, createVNode as k, normalizeClass as B, unref as P, withModifiers as M, createTextVNode as R, toDisplayString as w } from "vue";
|
|
2
|
+
import { ScalarTooltip as W, ScalarButton as z } from "@scalar/components";
|
|
3
|
+
import { requestExampleParametersSchema as V } from "@scalar/oas-utils/entities/spec";
|
|
4
|
+
import D from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
5
|
+
import C from "./RequestTable.vue.js";
|
|
6
|
+
import { useWorkspace as G } from "../../../store/store.js";
|
|
7
|
+
const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, j = { class: "sr-only" }, I = /* @__PURE__ */ S({
|
|
8
8
|
__name: "RequestParams",
|
|
9
9
|
props: {
|
|
10
10
|
example: {},
|
|
@@ -18,127 +18,118 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
18
18
|
invalidParams: {}
|
|
19
19
|
},
|
|
20
20
|
setup(t) {
|
|
21
|
-
const { requestExampleMutators: s } =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
y
|
|
21
|
+
const { requestExampleMutators: s } = G(), n = m(() => t.example.parameters[t.paramKey] ?? []);
|
|
22
|
+
N(() => {
|
|
23
|
+
p(() => {
|
|
24
|
+
y();
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
|
-
const
|
|
28
|
-
const e =
|
|
27
|
+
const o = () => {
|
|
28
|
+
const e = V.parse({ enabled: !1 }), a = [...n.value, e];
|
|
29
29
|
s.edit(t.example.uid, `parameters.${t.paramKey}`, a);
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
const l = [...
|
|
30
|
+
}, u = x(null), K = (e, a, r) => {
|
|
31
|
+
const c = n.value;
|
|
32
|
+
if (c.length > e) {
|
|
33
|
+
const l = [...c];
|
|
34
34
|
if (!l[e])
|
|
35
35
|
return;
|
|
36
|
-
l[e] = { ...l[e], [a]:
|
|
36
|
+
l[e] = { ...l[e], [a]: r }, (l[e].key !== "" || l[e].value !== "") && (l[e].enabled = !0), l[e].key === "" && l[e].value === "" && l.splice(e, 1), s.edit(
|
|
37
37
|
t.example.uid,
|
|
38
38
|
`parameters.${t.paramKey}`,
|
|
39
39
|
l
|
|
40
40
|
);
|
|
41
41
|
} else {
|
|
42
|
-
const l = [
|
|
43
|
-
s.edit(t.example.uid, `parameters.${t.paramKey}`, l),
|
|
44
|
-
var
|
|
45
|
-
if (!
|
|
42
|
+
const l = [V.parse({ [a]: r })];
|
|
43
|
+
s.edit(t.example.uid, `parameters.${t.paramKey}`, l), p(() => {
|
|
44
|
+
var g;
|
|
45
|
+
if (!u.value)
|
|
46
46
|
return;
|
|
47
|
-
(
|
|
47
|
+
(g = u.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || g.focus();
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
e ===
|
|
51
|
-
},
|
|
50
|
+
e === c.length - 1 && o();
|
|
51
|
+
}, $ = (e, a) => s.edit(
|
|
52
52
|
t.example.uid,
|
|
53
53
|
`parameters.${t.paramKey}.${e}.enabled`,
|
|
54
54
|
a
|
|
55
|
-
),
|
|
55
|
+
), q = () => {
|
|
56
56
|
const e = n.value.filter((a) => a.required);
|
|
57
57
|
s.edit(
|
|
58
58
|
t.example.uid,
|
|
59
59
|
`parameters.${t.paramKey}`,
|
|
60
60
|
e
|
|
61
|
-
),
|
|
62
|
-
},
|
|
61
|
+
), p(() => o());
|
|
62
|
+
}, E = (e) => {
|
|
63
63
|
const a = n.value;
|
|
64
64
|
if (a.length > e) {
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const r = [...a];
|
|
66
|
+
r.splice(e, 1), s.edit(
|
|
67
67
|
t.example.uid,
|
|
68
68
|
`parameters.${t.paramKey}`,
|
|
69
|
-
|
|
69
|
+
r
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
function
|
|
73
|
+
function y() {
|
|
74
74
|
if (n.value.length === 0)
|
|
75
|
-
|
|
75
|
+
o();
|
|
76
76
|
else if (n.value.length >= 1) {
|
|
77
77
|
const e = n.value[n.value.length - 1];
|
|
78
|
-
e && e.key !== "" && e.value !== "" &&
|
|
78
|
+
e && e.key !== "" && e.value !== "" && o();
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const T = m(
|
|
82
82
|
() => n.value.filter((e) => e.key || e.value).length
|
|
83
|
-
),
|
|
84
|
-
() => y.value && n.value.length > 1
|
|
85
|
-
);
|
|
83
|
+
), O = m(() => n.value.length > 1);
|
|
86
84
|
A(
|
|
87
85
|
() => t.example,
|
|
88
86
|
(e, a) => {
|
|
89
|
-
e !== a &&
|
|
87
|
+
e !== a && y();
|
|
90
88
|
},
|
|
91
89
|
{ immediate: !0 }
|
|
92
90
|
);
|
|
93
|
-
const
|
|
94
|
-
return (e, a) => (
|
|
91
|
+
const b = m(() => (t.readOnlyEntries ?? []).length > 0);
|
|
92
|
+
return (e, a) => (v(), d(D, {
|
|
95
93
|
class: "group/params",
|
|
96
|
-
itemCount:
|
|
94
|
+
itemCount: T.value
|
|
97
95
|
}, {
|
|
98
96
|
title: i(() => [
|
|
99
|
-
|
|
97
|
+
R(w(e.title), 1)
|
|
100
98
|
]),
|
|
101
99
|
actions: i(() => [
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
f("div", U, [
|
|
101
|
+
O.value ? (v(), d(P(W), {
|
|
104
102
|
key: 0,
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
content: "Clear optional parameters",
|
|
104
|
+
placement: "left"
|
|
107
105
|
}, {
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
default: i(() => [
|
|
107
|
+
k(P(z), {
|
|
110
108
|
class: "pr-0.75 pl-1 transition-none",
|
|
111
109
|
size: "sm",
|
|
112
110
|
variant: "ghost",
|
|
113
|
-
onClick: M(
|
|
111
|
+
onClick: M(q, ["stop"])
|
|
114
112
|
}, {
|
|
115
113
|
default: i(() => [
|
|
116
|
-
a[0] || (a[0] =
|
|
117
|
-
|
|
114
|
+
a[0] || (a[0] = R(" Clear ")),
|
|
115
|
+
f("span", j, "All " + w(e.title), 1)
|
|
118
116
|
]),
|
|
119
117
|
_: 1
|
|
120
118
|
})
|
|
121
119
|
]),
|
|
122
|
-
content: i(() => a[1] || (a[1] = [
|
|
123
|
-
r("div", { class: "w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
|
|
124
|
-
r("div", { class: "text-c-2 flex items-center" }, [
|
|
125
|
-
r("span", null, "Clear optional parameters")
|
|
126
|
-
])
|
|
127
|
-
], -1)
|
|
128
|
-
])),
|
|
129
120
|
_: 1
|
|
130
|
-
})) :
|
|
121
|
+
})) : h("", !0)
|
|
131
122
|
])
|
|
132
123
|
]),
|
|
133
124
|
default: i(() => [
|
|
134
|
-
|
|
125
|
+
f("div", {
|
|
135
126
|
ref_key: "tableWrapperRef",
|
|
136
|
-
ref:
|
|
127
|
+
ref: u
|
|
137
128
|
}, [
|
|
138
|
-
|
|
129
|
+
b.value ? (v(), d(C, {
|
|
139
130
|
key: 0,
|
|
140
131
|
class: B(["flex-1", {
|
|
141
|
-
"bg-mix-transparent bg-mix-amount-95 bg-c-3":
|
|
132
|
+
"bg-mix-transparent bg-mix-amount-95 bg-c-3": b.value
|
|
142
133
|
}]),
|
|
143
134
|
columns: ["32px", "", ""],
|
|
144
135
|
envVariables: e.envVariables,
|
|
@@ -149,8 +140,8 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
149
140
|
items: e.readOnlyEntries,
|
|
150
141
|
label: e.label,
|
|
151
142
|
workspace: e.workspace
|
|
152
|
-
}, null, 8, ["class", "envVariables", "environment", "invalidParams", "items", "label", "workspace"])) :
|
|
153
|
-
|
|
143
|
+
}, null, 8, ["class", "envVariables", "environment", "invalidParams", "items", "label", "workspace"])) : h("", !0),
|
|
144
|
+
k(C, {
|
|
154
145
|
class: "flex-1",
|
|
155
146
|
columns: ["32px", "", ""],
|
|
156
147
|
envVariables: e.envVariables,
|
|
@@ -159,9 +150,9 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
159
150
|
items: n.value,
|
|
160
151
|
label: e.label,
|
|
161
152
|
workspace: e.workspace,
|
|
162
|
-
onToggleRow:
|
|
163
|
-
onUpdateRow:
|
|
164
|
-
onDeleteRow:
|
|
153
|
+
onToggleRow: $,
|
|
154
|
+
onUpdateRow: K,
|
|
155
|
+
onDeleteRow: E
|
|
165
156
|
}, null, 8, ["envVariables", "environment", "invalidParams", "items", "label", "workspace"])
|
|
166
157
|
], 512)
|
|
167
158
|
]),
|
|
@@ -170,5 +161,5 @@ const j = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
|
|
|
170
161
|
}
|
|
171
162
|
});
|
|
172
163
|
export {
|
|
173
|
-
|
|
164
|
+
I as default
|
|
174
165
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAuVA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAUrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA2XF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-53db5ccb"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|